jqDataVisualization for jQuery Documentation

Chart.Crosshairs


Defines chart crosshairs.

Sample configuration:

var crosshairsConfig = {
     enabled: true,
     hLine: { strokeStyle: '#cc0a0c' },
     vLine: { strokeStyle: '#cc0a0c' }
}

Example usage:

$(document).ready(function () {
     $('#selector').jqChart({
        title: { text: 'Crosshairs' },
        tooltips: {
            disabled: true,
            type: 'shared'
        },
        crosshairs: {
            enabled: true,
            hLine: { strokeStyle: '#cc0a0c' },
            vLine: { strokeStyle: '#cc0a0c' }
        },
        series: [
         {
            type: 'spline',
            title: 'Series 1',
            data: [[1, 62], [2, 70], [3, 68], [4, 58], 
                   [5, 52], [6, 60], [7, 48], [8, 52],
                   [9, 54], [10, 47], [11, 49]]
         },
         {
            type: 'spline',
             title: 'Series 2',
             data: [[1, 56], [2, 30], [3, 62], [4, 65],
                    [5, 40], [6, 36], [7, 70], [8, 68], 
                    [9, 60], [10, 65], [11, 68]]
         }
       ]
  }
 }
Defined By

Config options

Chart.Crosshairs
: Boolean
Specifies whether or not the crosshairs should be enabled. ...

Specifies whether or not the crosshairs should be enabled.

Defaults to: false

Chart.Crosshairs
: Boolean/Object
Specifies the horizontal line settings. ...

Specifies the horizontal line settings.

Defaults to: {visible: true, strokeStyle: 'red'}

Chart.Crosshairs
: Boolean
Specifies whether or not the crosshairs should be snap to data points or move with the mouse. ...

Specifies whether or not the crosshairs should be snap to data points or move with the mouse.

Defaults to: true

Chart.Crosshairs
: Boolean/Object
Specifies the vertical line settings. ...

Specifies the vertical line settings.

Defaults to: {visible: true, strokeStyle: 'red'}