Home Forums Chart Support Crosshair label behind chart

Crosshair label behind chart

Viewing 5 posts - 1 through 5 (of 5 total)
  • #18283

    Hi,

    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:
    https://canvasjs.com/docs/charts/chart-options/axisy/crosshair/

    I change the axisY-part to the following:
    axisY: {
    crosshair: {
    enabled: true,
    labelWrap: false
    },
    labelAngle: 90,
    }

    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?

    #18285

    @gregoff,

    It seems to be working fine, please check the screenshot below.
    Crosshair on Y Axis

    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.


    Vishwas R
    Team CanvasJS

    #18286

    Hi,

    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:
    https://jsfiddle.net/QwZuf/806/

    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.

    #18287

    @gregoff,

    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.


    Vishwas R
    Team CanvasJS

    #18291

    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!

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

You must be logged in to reply to this topic.