DrillDown with Context Menu
Shows the drilldown example with an integrated "Context Menu" to enable navigating the drill down hierarchy.
by Darth Vader
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/drilldown.js"></script>
<script src="http://purdws1f295/context.js"></script>
<script>
jQuery.ajaxSettings.traditional = true;
</script>
<div id="main">
</div>
JavaScript
/* Lookup to convert Month Number to a properish month and vice versa*/
var monthLookup = ["MONTHS", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
/* Holds commonly used data */
var SolrHelper = {
baseURL: "http://hyrdlt3115:99/solr/solrbi/select",
__defaultParams: {
/*http://hyrdlt3115:99/solr/solrbi/select?q=*%3A*&fq=isi_cl_ooid:G3PQT1CZVT5W6XTP&rows=0&wt=json&indent=true&stats=true&stats.field=tot_num_amndmts&stats.field=tot_num_rewrk_agy_ntcs&stats.facet=year",*/
q: '*:*',
rows: '0',
wt: 'json',
indent: true,
"stats.field": ['tot_num_amndmts', 'tot_num_rewrk_agy_ntcs'],
/*"stats.facet": 'year',*/
stats: true
},
__unencodedParams: [
"fq=isi_cl_ooid:G3PQT1CZVT5W6XTP&stats.facet=year"
],
getParams: function (params, unencoded) {
var returnValue = $.param((params) ? params : this.__defaultParams);
returnValue += (unencoded) ? "&" + unencoded.join("&") : "&" + this.__unencodedParams.join("&");
return returnValue;
}
}
/**
* Defines a drill down object.
* @param chartDetails as the details of the chart (can contain a bunch of highcharts related features along with a series parser and categories parser)
* @param baseURL as the base URL for the service.
* @param customParams as the custom parameters for this object.
* @param next (still undefined but present to allow linking charts to their successors)
*/
function DrillDownMetaData(chartDetails, baseURL, customParams, next) {
this.chartDetails = (chartDetails) ? chartDetails : {};
this.next = (next) ? next : undefined;
this.url = null;
this.params = (customParams) ? customParams : SolrHelper.getParams();
var metaRef = this;
/* A common render function used by all derivatives of this object */
this.render = function (renderer, customParams) {
...