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

Legend.item.line

configuration

Sets the configuration of the legend items of type line. This is the default legend item type for all line and scatter series.

<div id="chart"></div>
<script>
$("#chart").kendoStockChart({
  dataSource: {
    data: [{
      "Date": "2016/01/01",
      "Open": 41.62,
      "High": 41.69,
      "Low": 39.81,
      "Close": 40.12,
      "Volume": 2632000
    }, {
      "Date": "2016/03/01",
      "Open": 40.62,
      "High": 39.69,
      "Low": 40.81,
      "Close": 39.12,
      "Volume": 2631986
    }]
  },
  dateField: "Date",
  series: [{
    name: "Series 1",
    type: "candlestick",
    openField: "Open",
    highField: "High",
    lowField: "Low",
    closeField: "Close"
  }],
  legend: {
    visible: true,
    position: 'bottom',
    item: {
      line: {
        color: "#777",
      }
    }
  }
});
</script>

The color of the legend item of type line. Accepts a valid CSS color string, including HEX and RGB. Defaults to the series color.

<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: {
            line: {
                color: "blue"
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>

The dash type of the legend item of type line.

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
<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: {
            line: {
                dashType: "dash"
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>

The opacity of the legend item of type line. Defaults to the series opacity.

<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: {
            line: {
                opacity: 0.6
            }
        }
    },
    series: [{
        type: "line",
        field: "value",
        categoryField: "date",
        name: "Stock Price"
    }]
});
</script>