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(2023, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    background: "orange",
                    border: { color: "red", width: 2 }
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>

The background color of the highlighted legend item markers.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    background: "yellow"
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>

The border of the highlighted markers.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date(2023, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    border: {
                        color: "purple",
                        width: 3,
                        dashType: "dash"
                    }
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</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, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    type: "roundedRect",
                    borderRadius: 5
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</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, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    type: "triangle"
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</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, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    visible: true
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</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, 0, 1), value: 100 },
            { date: new Date(2023, 0, 2), value: 105 },
            { date: new Date(2023, 0, 3), value: 98 }
        ]
    },
    legend: {
        item: {
            highlight: {
                markers: {
                    visual: function(e) {
                        var rect = new kendo.geometry.Rect([0, 0], [10, 10]);
                        var path = kendo.geometry.Path.fromRect(rect);
                        var visual = new kendo.drawing.Path(path);
                        visual.stroke("red", 2);
                        visual.fill("yellow");
                        return visual;
                    }
                }
            }
        }
    },
    series: [{
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>