We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The Dash style of the legend items

Thread ID:

Created:

Updated:

Platform:

Replies:

97538 Dec 7,2010 05:14 PM UTC Dec 9,2010 08:37 AM UTC WinForms 4
loading
Tags: Chart
Leïla Benakezouh
Asked On December 7, 2010 05:14 PM UTC

Hi,
I wanted to change manually the dash style of the legends items.
I tried the following code:
chartControl.Legend.Items(0).Border.DashStyle = Drawing2D.DashStyle.Dot

But it makes no change.
The legend representation type I use is ChartLegendRepresentationType.StraightLine

If I try to change the symbol displayed on a specific Legend Item, it works perfectly using the code:
chartControl.Legend.Items(0).Symbol.Shape = ChartSymbolShape.Square

How to change the dash style o the legend items?

Thank you in advance for your help.



Subash Chandran M [Syncfusion]
Replied On December 8, 2010 07:31 AM UTC

Hi Leila,

Thanks for using Syncfusion products.

I am afraid, that I was unable to reproduce this issue. We have created a sample to meet your requirement, which shows the legend item dash style correctly.

Please check the code snippet below :
[C#]

chartControl1.Legend.Items[0].Border.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;

Kindly provide us the details of the Syncfusion Essential studio version that you are using to render Chart.

Please let me know if any concerns.

Regards,
Subash Chandran M



Leïla Benakezouh
Replied On December 8, 2010 09:16 AM UTC

Hi,
Thank you for your quick answer.

The code you write works perfectly except if the legend representation type is set to StraightLine
chartControl.Legend.RepresentationType = ChartLegendRepresentationType.StraightLine

In this particular case, the dash style cannot be changed.

I use the version Essential Studio V8.3.0.21

Regards.


Leïla Benakezouh
Replied On December 8, 2010 09:21 AM UTC

Hi,
Thank you for your quick answer.

The code you write works perfectly except if the legend representation type is set to StraightLine
chartControl.Legend.RepresentationType = ChartLegendRepresentationType.StraightLine

In this particular case, the dash style cannot be changed.

I use the version Essential Studio V8.3.0.21

Regards.


Subash Chandran M [Syncfusion]
Replied On December 9, 2010 08:37 AM UTC

Hi Leila,

Thanks for the update.

Internally, we are not using border setting of the legend item for the Cross, Line, StraightLine RepresentationType since it’s a single line. So, we suggest you to use LegendRepresentationType as SeriesType to have dash style for the borders.

Please check the code snippet below :
[C#]

chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.SeriesType;
chartControl1.Legend.Items[0].Border.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;


Let me know if any concerns.

Regards,
Subash Chandran M




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;