userDuR
userDuR

Reputation: 418

highstock issue : pointInterval property is not working when series data set contains date and value?

I used pointInterval property to set interval as 30 days but my data set contains daily data. That method is not working. chart is displaying all the points.

please check below image for the chart i got https://docs.google.com/file/d/0B1wfs7NUcZnGQkk2QWdEbE9ndmM/edit

What is needed is to draw only three points for three months in the above chart.

Following is the code i used to do this.

Note that 'options.data.points' has data set in format of [[date,value],[]....]

var stockChartData = { chart: { renderTo: 'container' }, title: { text: "Stock Chart" }, credits: { enabled: false }, yAxis: [ { labels: { align: 'left', x: 2 }, title: { enabled: false }, lineWidth: 2 }
], navigation: { buttonOptions: { enabled: false } }, scrollbar: { enabled: false }, series: [{data: options.data.points, type: 'line', pointInterval: 24 * 3600 * 1000 *30}] }; stockChart = new Highcharts.StockChart(stockChartData, function (chart) { });

please help me to solve this issue

Upvotes: 1

Views: 598

Answers (1)

Raein Hashemi
Raein Hashemi

Reputation: 3384

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/plotoptions/pointinterval-pointstart/

The data set this example uses is in the format of [value,value,...] (see http://www.highcharts.com/samples/data/large-dataset.js).

So when pointInterval for a month is used, for example the last two values will be used for the values of last two months. For the same data when pointInterval for a year is used, the same last two values is used for the last two years. So the chart doesn't ignore the between values, therefore you will not have for example an average value of the month for day values.

EDIT:

You can use plotOptions.series.dataGrouping for grouping the day values in a month:

http://jsfiddle.net/worhscy0/

Upvotes: 1

Related Questions