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

The crosshair configuration options.

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      color: "green",
      width: 2,
      visible: true
    }
  },
  series: [{
    type: "line",
    data: [1, 2, 3]
  }]
});
</script>

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      color: "green",
      visible: true
    }
  },
  series: [
    { type: "line", 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({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      dashType: "dashDot",
      visible: true
    }
  },
  series: [{
    type: "line",
    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({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      opacity: 0.1,
      visible: true
    }
  },
  series: [{
    type: "line",
    data: [1, 2, 3]
  }]
});
</script>

The crosshair tooltip options.

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      tooltip: {
        background: "green",
        border: {
          color: "black",
          width: 2
        },
        visible: true
      },
      visible: true
    }
  },
  series: [
    {
      type: "line",
      data: [1, 2, 3]
    }
  ]
});
</script>

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

Default: false

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

The width of the crosshair in pixels.

Default: 1

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  categoryAxis: {
    categories: ["2012", "2013"],
    crosshair: {
      width: 2,
      visible: true
    }
  },
  series: [
    { type: "line", data: [1, 2, 3] }
  ]
});
</script>