Home forums Using CanvasJS Y-Axis Minimum,Maximum and Interval Manual Plotting

This topic contains 4 replies, has 2 voices, and was last updated by  muralimnmcse 4 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11601

    muralimnmcse
    Member

    Hai,
    I have my own standardised logic for calculating the max,min and interval values for my graphs, but when i apply the same in canvas the max,min and interval values gets auto changed. Please let me know how to avoid the same.
    Sample:
    var chart = new CanvasJS.Chart(“chartContainer”, {
    title:{
    text: “Plotting Interval Issue in CanvasJS”
    },
    data: [
    {
    // Change type to “doughnut”, “line”, “splineArea”, etc.
    type: “column”,
    axisY:{
    minimum: -2100,
    maximum: 10236,
    interval: 3003,
    },
    dataPoints: [
    { label: “apple”, y: 8897.10 },
    { label: “orange”, y: 2608.39 },
    { label: “banana”, y: -2088.73 },
    { label: “mango”, y: 1971.12 },
    { label: “watermelon”, y: 1971.12 },
    { label: “grape”, y: 138.52 },
    { label: “carrot”, y: -615.21 },
    { label: “lemon”, y: -991.10 }
    ]
    }
    ]
    });

    chart.render();

    #11603

    Sanjoy
    Moderator

    Muralimnmcse,

    axisY is attributes of Chart options, not of dataSeries. Here is the working code in jsfiddle.

    #11637

    muralimnmcse
    Member

    Hi Sanjoy,

    I don’t have problem in data loading, the issue is with the plotting intervals,
    Sample:
    var chart = new CanvasJS.Chart(“chartContainer”, {
    title:{
    text: “Plotting Interval Issue in CanvasJS”
    },
    axisY:{
    minimum: -109,
    maximum: 60,
    interval: 42.25
    },
    data: [
    {
    // Change type to “doughnut”, “line”, “splineArea”, etc.
    type: “column”,
    dataPoints: [
    { label: “apple”, y: 51.9 },
    { label: “orange”, y: 7.75 },
    { label: “banana”, y: 5.07 },
    { label: “mango”, y: 2.59 },
    { label: “watermelon”, y: 2.58 },
    { label: “grape”, y: 1.09 },
    { label: “carrot”, y: 0.04 },
    { label: “lemon”, y: -0.01 },
    { label: “jackfruit”, y: -0.01 },
    { label: “custardapple”, y: -0.02 },
    { label: “butterfruit”, y: -29.11 },
    { label: “jackfruit”, y: -94.29 }
    ]
    }
    ]
    });

    chart.render();

    In the above sample the canvasjs automatically changes my max,min and intervals and the plotting intervals are -84.5,-42.25,0,42.25 but it should have been -109,-66.75,-24.5,17.75,60.

    #11639

    Sanjoy
    Moderator

    Sorry Muralimnmcse,

    minimum doesn’t set label/interval start position and as of now we don’t provide options to set interval/label start position, it’s in our road-map.

    #11640

    muralimnmcse
    Member

    Sanjoy,

    Thanks for your quick update, request you to keep me posted in this regards.

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

You must be logged in to reply to this topic.