I encountered an issue with my Highcharts chart when using the addSeries method along with two Y-axes.
As this project employs Backbone, I have simplified the code in a JSFiddle that can be accessed here: http://jsfiddle.net/michalcarson/V84pP/.
The code initializes a chart without any data, adds a second Y-axis, and then attempts to add data for the first series. However, at this point, an error occurs with the message "TypeError: tickPositions is undefined" in highcharts.src.js line 7315.
The data I am trying to include should be linked with the primary y-axis (chart.yAxis[0]), yet specifying this association or not leads to the same error. Further details are available on the JSFiddle link provided.
var chart,
options = {
chart: {
renderTo: 'chartdiv'
}
},
real_series = {
"data": [10.816667, 8.458333, 9.1, 8.794771, 7.91789, 7.281212,
6.671075, 6.08748, 5.530427, 4.999916, 4.495946, 4.018517, 3.567631]
};
chart = new Highcharts.Chart(options);
chart.addAxis({
id: "LCUReal",
title: { text: "LCU Real" },
opposite: true
}, false);
chart.addSeries(real_series);
The versions being used are jQuery 1.11.1 and Highcharts 4.0.3.
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/4.0.3/highcharts.src.js"></script>
<div id="chartdiv"></div>
Hence, the query arises: What could possibly be incorrect in this code? How can I successfully implement a second Y-axis without encountering this error?
I have not made use of tickPositions previously, leaving it for Highcharts to handle. Any insights would be greatly appreciated.