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").kendoChart({
  series: [{
    type: "line",
    name: "Series A",
    data: [1, 2, 3]
  }, {
    type: "line",
    name: "Series B",
    data: [4, 5, 6]
  }],
  legend: {
    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="chart"></div>
<script>
$("#chart").kendoChart({
  legend: {
    item: {
      line: {
        color: "purple"
      }
    }
  },
  series: [
    { name: "Line Series", data: [1, 2, 3], type: "line" }
  ]
});
</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
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  legend: {
    item: {
      line: {
        dashType: "dash",
        color: "red"
      }
    }
  },
  series: [
    { name: "Line Series", data: [1, 2, 3], type: "line" }
  ]
});
</script>
  • "longDashDotDot" - a line consisting of a repeating pattern of long-dash-dot-dot
  • "solid" - a solid line

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

<div id="chart"></div>
<script>
$("#chart").kendoChart({
  legend: {
    item: {
      line: {
        opacity: 0.7,
        color: "blue"
      }
    }
  },
  series: [
    { name: "Line Series", data: [1, 2, 3], type: "line" }
  ]
});
</script>