Legend type

1 Answer 112 Views
Charts
Fahime
Top achievements
Rank 1
Fahime asked on 27 Jan 2022, 02:16 PM

Hi,

I have a line chart to show two data series, I use two line types but the legend is not synced with the series dash type.


function GetSeries() {
		return [{
			name: chartTerms[68941],
			type: "line",
			dashType: "dot",
			field: "Benchmark",
			color: chartColors["LightPurple"],
			markers: {
				visible: false
			},
		},
		{
			name: chartTerms[7151],
			type: "line",
			field: "Result",
			color: chartColors["DarkPurple"],
			markers: {
				visible: false
			},
		}]
	}

what I see is:

The Benchmark legend is not correct, it should be "dot"

Any idea?

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Denchev
Telerik team
answered on 01 Feb 2022, 08:18 AM

Hi, Fahime,

Thank you for the provided snippet.

I'm assuming you're talking about the colored rectangle elements?

The legend items are not related to the type of the series. It doesn't matter if it's a line series or column series, or dot series, the items in the legend will always be rectangles, this is how the chart is intended to work.

You can use the legend.item.visual to draw a custom shapes instead of the default one.

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Fahime
Top achievements
Rank 1
commented on 01 Feb 2022, 08:24 AM

Hi,

thanks for your answer.

Tags
Charts
Asked by
Fahime
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or