I add dynamic series to the chart after I've downloaded all data needed. This works fine, however sometimes they doesn't show up.
After gathering all data into an array I call my method that adds series one by one:
for (icount = 0; icount < chartDataSource.length; icount++) { AddNewSerie(icount, "line", "xAxis1", "yAxis", "MeasureValue", mType); }
function AddNewSerie(_serieNumber, _type, _xaxis, _yaxis, _valueMemberPath, mType) { $("#chart").igDataChart("option", "series", [{ name: ""+chartDataSource[_serieNumber].ItemId, type: _type, xAxis: _xaxis, yAxis: _yaxis, dataSource: chartDataSource[_serieNumber].Measurements, valueMemberPath: _valueMemberPath, showTooltip: true, tooltipTemplate: "tooltipTemplate1", markerType: mType, brush: '#ffff00' }]); }
I've tried to set brush of every serie to the same to show if it is just about colors. Tried to get all series and write it to the console with the following command:
console.log($("#chart").igDataChart("option", "series"));
This just prints out an array with one object, and an undefined. Where can I find what series are loaded in the chart? Where can I remove them? How can I get its color by the name of the serie?
Should I remove all before trying to draw new ones on the chart? What's the preferred way adding and removing series? How can I handle them? What if I add one, see it is modifying y axis but doesn't appear any graphs?
I think I've found the reason of "sometimes". It looks like it doesn't show up the graph if it contains less or more values than the other one. I haven't tested it with three or more yet.
It turned out that less or more elements means shorter or longer x axes of the series. Until now I tried to set one axis to all the graphs which caused that sometimes different series didn't show up.
Now I add as many axes to the chart as many series I have. This works great, every series appears but I don't want to have 2-3-4-5 axes to be under the chart.
How can I add but hide axes? Is there a visible: false or something?