Sets the maximum value permitted on Axis. Values greater than maximum are clipped. maximum also set the upper limit while panning chart.
Default: Automatically Calculated based on the datavar chart = new CanvasJS.Chart("container", { . . axisY:{ maximum: 150, }, . . }); chart.render();
Also See:
9 Comments
Hi,
What if the difference between my minimum and maximum value is just .01? My graph shows no significant changes. I want to automatically change the points to like .01 to see the significant change in my graph. help please.
edit: I already fixed this by using the property includeZero=”false”; thanks!
what if I only want to put tickMarks on a specified minimum and maximum but i still want to show the rest of the graph beyond the maximum and below minimum?
vianece,
Sorry this is not possible.
Is it possible to calculate y-axis on a log-scale?
[Update]
We have just released v1.9.0 Beta-1 with logarithmic axis. Please refer to the release blog for more information.
Right now canvasjs api doesn’t have logarithmic axisY. But you can workaround this as shown in this jsfiddle.
[Update]
We have just released v1.9.0 Beta-1 with logarithmic axis. Please refer to the release blog for more information.
Hello, I am trying to display two charts side-by-side. mainChart displays the entire dataset with auto-scaled Y-axis. subChart shows a subset of the data but I would like its Y-axis to have the same scaling that was calculated for the mainChart, like this:
var mainChart = new CanvasJS.Chart(“container”,
{
axisY:{
// maximum not set (automatic scaling)
}, },
});
mainChart.render();
var subChart = new CanvasJS.Chart(“container”,
{…
},
});
subChart.options.axisY.maximum = mainChart.options.axisY.maximum,
subChart.render();
But mainChart.options.axisY.maximum is not defined. Is there another way to retrieve the axis range that was calculated?
Phil,
It is not possible to set the axis maximum from one chart to another chart directly. As a workaround you can calculate the maximum of Y-axis data and then assign the axisY maximum for both the charts using
chart1.options.axisY.maximum = chart2.options.axisY.maximum = maxValue(chart1.options.data[0].dataPoints);
Here is an example that will help you.