Home forums Using CanvasJS Shifting not completlty working

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 7 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10138

    kismal
    Member

    Hi,

    I’m trying to shift away some data as soon as there are more than 10 datapoints. My update functions looks like:

    `var updateChart = function (data) {
    var dt = new Date();

    dps.push({
    x: xVal,
    y: parseInt(data[‘value’]),
    toolTipContent: ‘Date: ‘ + dt + ‘<br />’ + ‘Value: {y}’
    });
    xVal++;

    if (dps.length > 10) {
    dps.shift();
    }
    chart.render()
    };`

    It works, but not completly. The data is shifted, but the x-axis is not shifted. So, I keep seeing 0, 1, 3, … . The line is shifted, so I only see the last 10 records. Any suggestions?

    #10143

    Vishwas R
    Keymaster

    Kismal,

    We are unable to reproduce the issue. Kindly create a fiddle so that we can help you out. Hope this link helps you for more information on creating dynamic charts.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.