kittyhawk
kittyhawk

Reputation: 698

Adding HighCharts Data Series With Property Names

I can create an array of data for use in a HighCharts series like this:

 mySeries.push([x, y, z]);

Then, I can use the following to direct my chart to use the data in the array as the series.

 options.series.push({
                   name: "MyData",
                    data: mySeries,
                    type: 'arearange',
                    lineWidth: 1,
                    color: Highcharts.getOptions().colors[0],
                    fillOpacity: 0.3,
                    zIndex: 0
                });

However, I want to push a object into my array rather than just the values. Like this:

mySeries.push({ x: thisDate, y: yValue, z: zValue });

When I do this, HighCharts doesn't display the series. How can I utilize an array of objects with named properties in a HighCharts series?

Upvotes: 1

Views: 853

Answers (1)

pawel_d
pawel_d

Reputation: 3070

Instead of using x, y, z, use x, low, high properties. Take a look at the example below.

Example:
http://jsfiddle.net/2Lx6yt7u/

Upvotes: 1

Related Questions