I am developing line charts. I have two chart series items. One of the chart series style is Line another one is Dashed line. I want the legend appearance exactly like how the series item is appeared in the chart. (like ----------- and - - - - - - )
3 Answers, 1 is accepted
answered on 11 Apr 2011, 08:27 AM
You can handle the BeforeLayout or PrePaint events of RadChart and customize the Marker.Appearance.Figure of the legend items to any of the predefined figures (unfortunately there is no predefined dashed line figure):
What I can suggest you is to set the Figure of the LegendItem Marker to Rectangle and set custom Height and Width for it so that it looks like a Line:
You can find more information on customizing the legend appearance here.
All the best,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
This is a going to be a recurring issues for Telerik support. Here is is application scenario -
I have period bar and accumulative line tied in pairs. We got accumulative line by summing up the periodic data.
So they have to be in the same color. Then how can we tell them apart? I think there are 2 options: change line thickness and change pen style. Unfortunately I have to use both. Accumulative curves on my chart looks thinner than the periodic bar, and for future accumulative forecast, I have to show the line type (pen type by your term) difference in the same color.
Since Telerik RadChart is not supporting legend marker by pen style, we are going though the painful process of re-evaluating this toolbox.
answered on 07 Aug 2012, 08:21 AM
As you can see in our documentation only Line and Spline Series support PenStyle property. Since there is no predefined line Legend Marker, you can't have a dashed/dotted line in the legend. However you may consider adding an image instead of using a predefined shape as legend item marker. This is described here.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.