1

I am calculating the average-value of properties for each week of the year. And I want to display these information in a line chart (x-Axis is the week of year, y-Axis the average value and the different lines represent different properties).

But for any given property I do not necessarily have a datapoint for each week of the year. If I do not have such a datapoint I want my line for this property to interpolate between the datapoints I have.

Anyone else run into a similiar issue?

Pascal Klein
  • 23,665
  • 24
  • 82
  • 119
  • So you mean calculate the missing data points based on averaging those on either side? eg. filling in the data? – nickhar Oct 23 '12 at 11:26

1 Answers1

2

Highcharts does not really do interpolation. Sure, if your series has a missing point it will draw the line between the adjacent two...but it is not a calculated "value" that you would want to publish. It is just the shortest distance between those two adjacent points. I would pre-process your data to fill in the missing points and then label these points as calculated with either a Note: value or maybe a color: value. Example where the second value is coming from your pre-processing:

data: [{ y: 7.0},
        {y: 6.9,
         Note: 'calculated',
         color: '#BF0B23'},
        {y: 9.5}]
wergeld
  • 14,332
  • 8
  • 51
  • 81