Home Forums Chart Support Crosshair and datapoints with labels

Crosshair and datapoints with labels

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

    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

    @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.