How to Limit the series data in highcharts just showing 10 data and short it desc? -


can 1 me limit data show in highchart,, have lot of data , want make 10 showing before need descanding data. 10 data high value..

    $(function () {     $('#container').highcharts({         chart: {             type: 'column'         },         title: {             text: 'menu terlaris'         },         xaxis: {             categories: [                 'menu'             ]         },         yaxis: {             min: 0,             title: {                 text: 'terjual (pesanan)'             }         },         tooltip: {                             formatter: function (tooltip) {             var items = this.points || splat(this),                 series = items[0].series,                 s;              // build header             s = [series.tooltipheaderformatter(items[0])];              // sort values             items.sort(function(a, b){                 return ((a.y < b.y) ? -1 : ((a.y > b.y) ? 1 : 0));             });             items.reverse();              // build values             $.each(items, function (i, item) {                 series = item.series;                 s.push((series.tooltipformatter && series.tooltipformatter(item)) ||                     item.point.tooltipformatter(series.tooltipoptions.pointformat) );             });              // footer             s.push(tooltip.options.footerformat || '');              return s.join('');         },         shared: true         },         plotoptions: {             column: {                 pointpadding: 0.2,                 borderwidth: 0             }         },         series: [         { name : 'name1', data:[100] },             { name : 'name2', data:[200] },             { name : 'name3', data:[300] },     ...     ] 

so want series data show in highchart 10 data descending 'data' value.

highcharts has no included limit module, can "cut" data in preprocessing (before chart initialization). in other words in i.e 150 points, can use slice "cut array" , initialize chart new data. desending values available when use reverted paramter on xaxis.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -