Home › forums › Using CanvasJS › Crosshair label behind chart
This topic contains 4 replies, has 2 voices, and was last updated by gregoff 1 year, 8 months ago.
First of all: The crosshair feature is just beautiful! Works very nice!
However, I have one question:
I slightly changed the example on this page:
I change the axisY-part to the following:
The issue that occurs is that the y-axis label is behind the chart itself and the value on the label is not fully shown. Is there any way to let the label to be fully visible above the chart?
It seems to be working fine, please check the screenshot below.
As you are setting labelWrap to false, labelMaxWidth for crosshair label will be limited to the space available for corresponding axis. Setting crosshair.labelMaxWidth would work fine in this case. Also you can set axisY.margin along with crosshair.labelMaxWidth if the crosshair label is getting clipped.
If this doesn’t solve the issue you are facing, kindly create a jsfiddle with the issue you are facing so that we can understand it better and help you out.
Thanks for your reply.
I should have been more clear by using a jsfiddle, sorry.
But, looking at this fiddle, it’s more visible what my issue is:
A nice solution would be if it was optional to have the label overlap the chart a bit in order for the value to be fully shown.
Thanks for the suggestion. I will discuss this with the team regarding this behavior for future versions. AS of now, you can set axisY margin to show label completely. Please check this updated jsfiddle.
thanks for your reply,
I suppose that will work, but the reason I have the labels vertically in the first place is to make sure that all my charts y-axis align with each other when the charts are lined up over and under each other. Also, the range of the values in my use case vary a lot.
So, an option to be able to have higher z-index on the label than the actual chart would be greatly appreciated.
Thanks again for your input. I’ve been looking forward to this feature for a long time and is the sole reason for for extending my subscription. Works very well!
You must be logged in to reply to this topic.