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="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2023/1/1"), value: 100 },
            { date: new Date("2023/1/2"), value: 105 },
            { date: new Date("2023/1/3"), value: 102 }
        ]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                color: "red",
                width: 2
            }
        },
        series: {
            type: "line",
            field: "value"
        }
    },
    series: [{
        field: "value",
        type: "line"
    }]
});
</script>

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

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2023/1/1"), value: 100 },
            { date: new Date("2023/1/2"), value: 105 },
            { date: new Date("2023/1/3"), value: 102 }
        ]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                color: "blue"
            }
        },
        series: {
            type: "line",
            field: "value"
        }
    },
    series: [{
        field: "value",
        type: "line"
    }]
});
</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="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2023/1/1"), value: 100 },
            { date: new Date("2023/1/2"), value: 105 },
            { date: new Date("2023/1/3"), value: 102 }
        ]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                dashType: "dash"
            }
        },
        series: {
            type: "line",
            field: "value"
        }
    },
    series: [{
        field: "value",
        type: "line"
    }]
});
</script>

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

Default: 1

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2023/1/1"), value: 100 },
            { date: new Date("2023/1/2"), value: 105 },
            { date: new Date("2023/1/3"), value: 102 }
        ]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                opacity: 0.5
            }
        },
        series: {
            type: "line",
            field: "value"
        }
    },
    series: [{
        field: "value",
        type: "line"
    }]
});
</script>

The crosshair tooltip options.

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

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2023/1/1"), value: 100 },
            { date: new Date("2023/1/2"), value: 105 },
            { date: new Date("2023/1/3"), value: 102 }
        ]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                tooltip: {
                    visible: true,
                    background: "yellow",
                    color: "black"
                }
            }
        },
        series: {
            type: "line",
            field: "value"
        }
    },
    series: [{
        field: "value",
        type: "line"
    }]
});
</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="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true
            }
        }
    }
});
</script>

The width of the crosshair in pixels.

Default: 1

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [{
            date: new Date("2016/01/01"),
            open: 41.62,
            high: 41.69,
            low: 39.81,
            close: 40.12,
            volume: 2632000
        }]
    },
    navigator: {
        categoryAxis: {
            crosshair: {
                visible: true,
                width: 3
            }
        }
    }
});
</script>