You must be logged in to post your query.
Home › Forums › Chart Support › Y-Axis Minimum,Maximum and Interval Manual Plotting
Tagged: Maximum and Interval Plotting Issue, Y-Axis Minimum
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();
Muralimnmcse,
axisY is attributes of Chart options, not of dataSeries. Here is the working code in jsfiddle.
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 } ] } ] });
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.
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.
Sanjoy,
Thanks for your quick update, request you to keep me posted in this regards.
Hi
Is it possible to dynamically change the axisY minimum value so that it is always the lowest y value? The example chart is https://negotiation.azurewebsites.net/helloworld.php. In this case I want the axisY minimum to be the lowest y value
Thanks
@reusen,
Yes, you can set axisY minimum to the lowest y-value. You can achieve that by finding the lowest y-value and changing axisY minimum using set method. Please take a look at this jsfiddle.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register