Chart legend markers matching series dash type

1 Answer 33 Views
Chart
Tarandeep
Top achievements
Rank 1
Tarandeep asked on 15 Nov 2023, 11:59 AM | edited on 15 Nov 2023, 12:02 PM

I have a kendo chart with two line series which have the same colour, but have different dash types, dotted and solid. On the chart legend, both series appear with solid lines, but I want the legend to have the dash type displayed - dotted or solid.

Using the HTMLHelper, I've tried to configure the legend using some settings within, but it was not clear from the documentation how this could be configured.

https://docs.telerik.com/aspnet-core/api/kendo.mvc.ui.fluent/chartlegenditemsettingsbuilder#chartlegenditemsettingsbuilder

            .Legend(legend =>
            {
                legend.Position(ChartLegendPosition.Top);
                legend.Item(x =>
                {
                    x.Visual("handler");
                });
            })

In the handler I can see there is options.markers.type, which is currently set to "rect", but from this API reference, there does not seem to be a dotted line type
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/series.markers.type

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 20 Nov 2023, 09:52 AM

Hi ,

 

Thank you for writing to us. I hope you are doing well.

The property you are looking for is called dash type:
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/series.dashtype

Can you give this a try and let me know if it helps you.

 

Regards,
Eyup
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Tarandeep
Top achievements
Rank 1
commented on 21 Nov 2023, 11:09 AM | edited

Hi Eyup,

Thanks for your reply. 

I can see the dashType under the series, but I am looking to configure the dashType of the legend item, so if a series is has a dashed line then the legend item is also dashed.

Here are the options I can see from the handler:

It seems like the legend dashType is not configurable via the handler. Can it be configured using JavaScript? Also if it helps, we are using version 2021.3.1109.

Many Thanks,

Tarandeep

 

Eyup
Telerik team
commented on 24 Nov 2023, 09:15 AM

Hi


Tags
Chart
Asked by
Tarandeep
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or