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

The markers configuration of the legend item when it is hovered.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
            { date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
        ]
    },
    dateField: "date",
    series: [{
        type: "line",
        field: "close",
        legendItem: {
            highlight: {
                markers: {
                    background: "red",
                    border: {
                        color: "blue",
                        width: 2
                    }
                }
            }
        }
    }]
});
</script>

The background color of the highlighted legend item markers.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
            { date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
        ]
    },
    dateField: "date",
    series: [{
        type: "line",
        field: "close",
        legendItem: {
            highlight: {
                markers: {
                    background: "orange"
                }
            }
        }
    }]
});
</script>

The border of the highlighted markers.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2000, 1, 1), open: 10, high: 15, low: 8, close: 12 },
            { date: new Date(2000, 1, 2), open: 12, high: 18, low: 10, close: 16 }
        ]
    },
    dateField: "date",
    series: [{
        type: "line",
        field: "close",
        legendItem: {
            highlight: {
                markers: {
                    border: {
                        color: "red",
                        width: 2,
                        dashType: "solid"
                    }
                }
            }
        }
    }]
});
</script>

The border radius in pixels when type is set to "roundedRect".

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 1, 1), open: 100, high: 110, low: 90, close: 105 },
            { date: new Date(2023, 1, 2), open: 105, high: 115, low: 95, close: 110 }
        ]
    },
    categoryField: "date",
    series: [{
        type: "candlestick",
        openField: "open",
        highField: "high",
        lowField: "low",
        closeField: "close",
        legendItem: {
            highlight: {
                markers: {
                    type: "roundedRect",
                    borderRadius: 8
                }
            }
        }
    }]
});
</script>

The highlighted markers shape.

The supported values are:

  • "circle" - the marker shape is circle.
  • "square" - the marker shape is square.
  • "triangle" - the marker shape is triangle.
  • "cross" - the marker shape is cross.
  • "rect" - alias for "square".
  • "roundedRect" - the marker shape is a rounded rectangle.
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 1, 1), open: 100, high: 110, low: 90, close: 105 },
            { date: new Date(2023, 1, 2), open: 105, high: 115, low: 95, close: 110 }
        ]
    },
    categoryField: "date",
    series: [{
        type: "candlestick",
        openField: "open",
        highField: "high",
        lowField: "low",
        closeField: "close",
        legendItem: {
            highlight: {
                markers: {
                    type: "triangle"
                }
            }
        }
    }]
});
</script>

If set to true the chart will display the legend item markers. Defaults to the series options.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 1, 1), open: 100, high: 110, low: 90, close: 105 },
            { date: new Date(2023, 1, 2), open: 105, high: 115, low: 95, close: 110 }
        ]
    },
    categoryField: "date",
    series: [{
        type: "candlestick",
        openField: "open",
        highField: "high",
        lowField: "low",
        closeField: "close",
        legendItem: {
            highlight: {
                markers: {
                    visible: false
                }
            }
        }
    }]
});
</script>

A function that can be used to create a custom visual for the highlighted markers. The available argument fields are:

  • rect - the kendo.geometry.Rect that defines where the visual should be rendered.
  • options - the marker options.
  • createVisual - a function that can be used to get the default visual.
  • category - the category of the marker point.
  • dataItem - the dataItem of the marker point.
  • value - the value of the marker point.
  • sender - the chart instance.
  • series - the series of the marker point.
<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 1, 1), open: 100, high: 110, low: 90, close: 105 },
            { date: new Date(2023, 1, 2), open: 105, high: 115, low: 95, close: 110 }
        ]
    },
    categoryField: "date",
    series: [{
        type: "candlestick",
        openField: "open",
        highField: "high",
        lowField: "low",
        closeField: "close",
        legendItem: {
            highlight: {
                markers: {
                    visual: (e) => {
                        var rect = new kendo.geometry.Rect([0, 0], [10, 10]);
                        var path = new kendo.drawing.Path({
                            fill: { color: "#ff6800" },
                            stroke: { color: "#000", width: 1 }
                        });
                        path.moveTo(5, 0).lineTo(10, 10).lineTo(0, 10).close();
                        return path;
                    }
                }
            }
        }
    }]
});
</script>