Home forums Using CanvasJS Crosshair and datapoints with labels

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 4 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20717

    psergey
    Member

    Hi,
    We are using crosshair on axises and custom labels for the data points.
    If we point any items with the crosshair then chart highlight on axis real value instead of label.
    So if you have

    
    data: [
          {
            type: "line",
            dataPoints: [
            { y: 71, x:1, label: "0"},
            { y: 55, x:2, label: "0.56"},
            { y: 50, x:3, label: "0.56"},
            { y: 65, x:4, label: "0.56"},
            { y: 95, x:5, label: "1"},
            { y: 68, x:6, label: "1"},
            { y: 28, x:7, label: "5"},
            { y: 34, x:8, label: "5"},
            { y: 14, x:9, label: "11"}
            ]
          }
    

    then correct X-label displayed, but if user select point with the crosshair then X-value displayed top on X-label.

    Please, see next example:
    https://jsfiddle.net/tn2u0650/38/

    #20718

    Vishwas R
    Keymaster

    @psergey,

    Crosshair labels are showing real value due to x-values in the datapoint. You can remove x-values to show actual label in crosshair or you can use labelFormatter as shown in this updated jsfiddle.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.