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. Image for the cookie policy date

Series Point Shape and Legend Shape

Hi,
V4.4.0.51 & VS2005

I try to make my chart lines with different shape-point (such as cross,circle,diamond,rectangle,triangle etc) and the legend shape display a line with the same shape. The reason I want this is to make chart to be seen clearer when it is printed black-white.

I make a simple sample chart in Excel. How can I get the similar chart in ChartControl? It will be helpful if you have some sample.
Thanks,

Lan




PointLegendShape.zip

11 Replies

RR Ramya R Syncfusion Team January 25, 2007 05:45 AM UTC

Hi Lan,

My apologies for the delay in responding to you.

You can have the Legend Shape to be same as the Series shape as in the image sent by you by setting the Legend RepresentationType as SeriesImage and assigning the imageindex value for each legend.
The images should also be added to the ImageCollection of the Series before performing the above steps.

Kindly take a look at the code snippet below,

series1.Style.Images = new ChartImageCollection(this.imageList1.Images);
series2.Style.Images = new ChartImageCollection(this.imageList1.Images);

this.chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.SeriesImage;
this.chartControl1.Legend.Items[0].ImageIndex = 0;
this.chartControl1.Legend.Items[1].ImageIndex = 1;

Also take a look at the attached sample.

Let me know if you have any queries.

Thanks & Regards,
Ramya.

LineChartSample0.zip


AD Administrator Syncfusion Team January 25, 2007 06:52 PM UTC

Hi,
I am sorry I am developing in VS2003. I don't have VS2005 right now. Could you make your sample in VS2003?

Thanks,

Lan


RR Ramya R Syncfusion Team January 30, 2007 01:14 PM UTC

Hi Lan,

My apologies for the delay in responding to you.

I have attached the VS2003 version of the previously sent sample with this post.

Kindly take a look at the attached sample and let me know whether this helps you.

Thanks & Regards,
Ramya.


LineChart5.zip


AD Administrator Syncfusion Team February 1, 2007 04:32 PM UTC

Thank you very much. That is what I want.

One more quesion. Which property do I set to display the point value?

Lan


AD Administrator Syncfusion Team February 1, 2007 05:10 PM UTC

Hi Ramya,
when user customize series style, they may change the line color and shape as my attached file. The legend image line color and shape should change accordingly. This is difficult to dynamiclly change it because the legend image stored in ImageList is pre-fixed.
do you have any built-in function to automaticlly to display legend image with line's shape and color?

Lan



LegendImage.zip


AD Administrator Syncfusion Team February 2, 2007 11:45 AM UTC

Hi Lan,

If your intention is to display the items of Legend with the shape same as that appearing along with the Line and with the color of the LegendItem's shape being same as the color of Line then it can be done as shown in the code snippet below,

this.chartControl1.Legend.Items[0].Type=ChartLegendItemType.Diamond;
this.chartControl1.Legend.Items[0].Interior=new Syncfusion.Drawing.BrushInfo(Color.Blue);

Also kindly take a look at the attached sample to get the above points in clear.

Let me know if I am wrong in getting your requirement.

Thanks & Regards,
Ramya.


LineChart6.zip


LM Lan Mo February 2, 2007 04:15 PM UTC

That is very close.
I want to show both the shape and line. I also want to display the check box left to the legend image. I modified your code little bit as following.

this.chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.Line;
//this.chartControl1.Legend.Items[0].Type=ChartLegendItemType.Diamond;
//this.chartControl1.Legend.Items[0].Interior=new Syncfusion.Drawing.BrushInfo(Color.Blue);
//this.chartControl1.Legend.Items[1].Type=ChartLegendItemType.Circle;
//this.chartControl1.Legend.Items[1].Interior=new Syncfusion.Drawing.BrushInfo(Color.Orange);

//this.chartControl1.Legend.VisibleCheckBox=true;
this.chartControl1.Legend.ShowSymbol=true;

The problem is when I turn set the this.chartControl1.Legend.VisibleCheckBox=true;

The legend shape will disappear. any ideas?

Thanks,

Lan




AD Administrator Syncfusion Team February 5, 2007 12:16 PM UTC

Hi Lan,

Both the shape and line can be displayed in the legend only by using images as in the sample sent by me on 30th January.

I was not able to reproduce the condition with regard to setting the this.chartControl1.Legend.VisibleCheckBox=true;

Kindly take a look at the attached screenshot.

Thanks & Regards,
Ramya.

CheckBox.zip


AD Administrator Syncfusion Team February 5, 2007 03:33 PM UTC

Hi,
I found I can use following code to display both line and shape.

this.chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.Line;
this.chartControl1.Legend.ShowSymbol=true;

I've modified your sample and attached here for your review.

The problem is when the Checkbox displays, the shape disappeared. I am not sure if it is a bug in chart control? In my revised sample, you can see it by clicking the 'Display/Hide checkbox' to toggle to display or hide the checkbox.
Thanks for help.

Lan






LineChart7.zip


AD Administrator Syncfusion Team February 8, 2007 09:11 AM UTC

Hi Lan,

I am happy to hear that you got the condition of displaying both line and shape.

Thanks a lot for the modified sample and code snippet.

With regard to checkbox issue, you are right it is a bug in ChartControl. Thanks for bringing this issue to our attention. I will forward this issue to our developers and let you the timeframe for the fix of this issue by next week.

Thank You for your patience and co-operation.

Regards,
Ramya.


AD Administrator Syncfusion Team February 20, 2007 09:36 AM UTC

Hi Lan

This issue has been forwarded to our developers .We will update with the fix for this issue on or before March 12th 2007. You can keep track of the progress of this issue from the below link

http://www.syncfusion.com/support/issues/chart/Default.aspx?ToDo=view&questId=3638

Thanks and Regards,
Sharmila


Loader.
Live Chat Icon For mobile
Up arrow icon