Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Dynamically added series sometimes don't show up.
posted

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?