Home Forums Chart Support Pushing a datapoint in front

Pushing a datapoint in front

Viewing 6 posts - 1 through 6 (of 6 total)
  • #11457

    Hello and thank you for this wonderful tool.

    I am trying to add a datapoint on the go to the graph and using chart.options.data[0].dataPoints.push({ y: 25 - Math.random() * 10}); works fine when we are adding a new point to the end of the graph.

    However should I wish to add a a new point at the beginning of the graph (on x-axis) using the unshift method instead of push the y axis gets draw accordingly but the x axis stays the same and doesn’t take the gap like pushing does.

    Any help wpuld be great.

    #11459

    Hi,

    In this case you have to assign x value also or you need to increase auto assigned x value for each dataPoints. Please check this example.

    #11467

    Brilliant thank you

    #11611

    Hello again,

    I have noticed that when assigning a negative value to x I am getting unwanted values on the x axis (on certain graph widths) however this isn’t the issues with positive number assigned to x values.

    This link is a forked version of yours with two graphs, one for negative x values and one for positive x values:
    http://jsfiddle.net/Kustuldi/cfbhkz8z/

    Any help would be great,
    Regards Chris

    #11613

    Thanks, for reporting the issue. It’s a bug, and we have just fixed the same. Here is an internal build for you.

    #11615

    Fixed it thank you

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

You must be logged in to reply to this topic.