New to Kendo UI for jQuery? Start a free 30-day trial

The crosshair configuration options.

The crosshair is displayed when the axisDefaults.crosshair.visible option is set to true.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      color: "green",
      width: 2,
      zIndex:1,
      visible: true
    }
  },
  series: [
    { type: "column", data: [[1, 2], [3, 4], [4, 5]] }
  ]
});
</script>

The color of the crosshair. Accepts a valid CSS color string, including hex and rgb.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      color: "blue",
      visible: true
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The dash type of the crosshair.

The following dash types are supported:

  • "dash" - a line consisting of dashes
  • "dashDot" - a line consisting of a repeating pattern of dash-dot
  • "dot" - a line consisting of dots
  • "longDash" - a line consisting of a repeating pattern of long-dash
  • "longDashDot" - a line consisting of a repeating pattern of long-dash-dot
  • "longDashDotDot" - a line consisting of a repeating pattern of long-dash-dot-dot
  • "solid" - a solid line

Default: "solid"

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      dashType: "dash",
      visible: true
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The opacity of the crosshair. By default the crosshair is opaque.

Default: 1

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      visible: true,
      opacity: 0.5
    }
  },
  series: [{
    type: "line",
    data: [1, 2, 3, 4]
  }]
});
</script>

The crosshair tooltip options.

The crosshair tooltip is displayed when the axisDefaults.crosshair.tooltip.visible option is set to true.

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      tooltip: {
        visible: true,
        background: "yellow",
        color: "black"
      },
      visible: true
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

If set to true the chart will display the axis crosshair. By default the axis crosshair is not visible.

Default: false

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      visible: true
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>

The width of the crosshair in pixels.

Default: 1

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  axisDefaults: {
    crosshair: {
      width: 5,
      visible: true
    }
  },
  series: [
    { data: [1, 2, 3] }
  ]
});
</script>