Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to: draw a custom legend marker for a series

$
0
0
This example demonstrates one of possible ways to use the CustomDrawSeries event. In this sample the event is used to modify the legend markers of bar series.
Question Comments

Added By: Ralf Boscher at: 7/29/2016 4:51:26 AM    Hello,

the example only draws rectangles - how to draw:
 
DashStyle.Dash

DashStyle.DashDot

DashStyle.DashDotDot

DashStyle.Dot

DashStyle.Dash

Thank you
Ralf

Added By: Ralf Boscher at: 7/29/2016 4:53:04 AM    Hello,
how to draw dots, dashdot or DashDotDot etc.
Thank you
Ralf Added By: Rоman K (DevExpress) at: 7/29/2016 5:25:59 AM    Hello, Ralf.

In this example, legend markers are images rendered using the System.Drawing.Graphics class. To draw lines with the required DashStyle, use the following approach.
[C#]
graphics.DrawLine(newPen(e.LegendDrawOptions.Color){DashStyle=isSelected?System.Drawing.Drawing2D.DashStyle.DashDotDot:System.Drawing.Drawing2D.DashStyle.Dash,Width= 4},newPoint(0,totalHeight/ 2),newPoint(totalWidth,totalHeight/ 2));

Feel free to contact us if you need further assistance.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>