Home › forums › Using CanvasJS › What can cause axisX and axisY to be undefined?
This topic contains 1 reply, has 2 voices, and was last updated by Indranil Deo 1 year, 2 months ago.
I haven’t looked at my canvasjs project for over a month or so, and last time I touched it it was working fine.
I access the axis objects like so: chart.axisY. My chart is not undefined and when I log the chart object and I can see that the axis objects are being set correctly. I was wondering what can cause the axis to be undefined?
Here is how I set the y axis
title: “Curve Data”,
and here is where is try to access axisY
`for(var i = chart.axisY.get(“minimum”); i < chart.axisY.get(“maximum”); i+=chart.axisY.get(“interval”))
value: i, color: “transparent”, label: i, showOnTop: true, labelAlign: “near”, labelFontColor: “black”
Kindly make sure that chart is rendered before get method is used.
If the issue still persists, can you kindly create a jsfiddlereproducing the same so that we can understand your requirements better and help you out.
You must be logged in to reply to this topic.