Home Forums Chart Support Undetermined number of Y Axis

Undetermined number of Y Axis

Viewing 4 posts - 1 through 4 (of 4 total)
  • #27028

    I am updating my charts dynamically from an external JSON object.
    My chart will display multiple Y axis and the number of Y axis is determined by the volume of data read in from the JSON file.
    How do I create a chart with an undetermined number of Y Axis?

    #27042

    @1alexritchie1,

    Can you please create a JSFiddle reproducing the issue and also provide the sample JSON data so that we can look into it, understand the scenario better and help you out.

    ___________
    Indranil Deo
    Team CanvasJS

    #27050

    I have created this JSFiddle: https://jsfiddle.net/zLxpsth8/

    Basically, where the data transforms from 10 to 15 in the different ID i want to have them as 2 different lines on the graph.
    However, although the data is in this format:
    [
    {
    “id”: “4568ID214”,
    “data”: [
    10,
    10,
    10,
    10,
    10
    ]
    },
    {
    “id”: “5687ID556”,
    “data”: [
    15,
    15,
    15,
    15,
    15
    ]
    }
    ]

    I have know way of knowing how many objects containing ID & Data will be in the JSON object with each of them to get their own line on the chart.

    • This reply was modified 4 years, 6 months ago by 1alexritchie1. Reason: Added further detail
    #27095

    @1alexritchie1,

    You can loop through the JSON and parse it to the format accepted by CanvasJS as shown in the JSFiddle.

    ___________
    Indranil Deo
    Team CanvasJS

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

You must be logged in to reply to this topic.