Home forums Using CanvasJS Dynamic data issue

This topic contains 3 replies, has 3 voices, and was last updated by  ashish.potdar 9 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14265

    Hello,
    I am facing problem while assigning the values dynamically to CanvaJs.
    Please the jsfiddle editor.

    http://jsfiddle.net/QwZuf/548/

    Please check the issue asap.

    Thanking you.
    Regards,
    Ashish.

    #14277

    Suyash Singh
    Moderator

    @ashish-potdar,

    The dataPoints you pass to the chart must be an array of objects and not a string.

    var MyVal = (document.getElementById('txtGrpValue').value); \\ String

    First you need to parse the string you get from your input field to a valid JSON and then parse the JSON to get the object which you can pass to the chart. For converting the string to valid JSON, you can either enclose the values x and y in quotes in the input field and remove the semicolon like this example. Or you could use regular expression as shown in this example.


    Suyash
    Team CanvasJS

    #14278

    jonasbui1476
    Member

    @ashish.potdar,
    FYI tuturial. This tutorial was a great one.

    #14280

    Dear Suyash,
    Thanks for your prompt reply. Your both solution helped me to sort out my problem.
    Keep it up Canvasjs team.

    Regards,
    Ashish Potdar.

    • This reply was modified 9 months, 2 weeks ago by  ashish.potdar.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.