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.
Unfortunately, activation email could not send to your email. Please try again.

Series Point Shape and Legend Shape

Thread ID:

Created:

Updated:

Platform:

Replies:

55098 Jan 23,2007 04:41 PM Feb 20,2007 04:36 AM Windows Forms 11
loading
Tags: Chart
Administrator [Syncfusion]
Asked On January 23, 2007 04:41 PM

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

Ramya R [Syncfusion]
Replied On January 25, 2007 12:45 AM

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

Administrator [Syncfusion]
Replied On January 25, 2007 01:52 PM

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

Ramya R [Syncfusion]
Replied On January 30, 2007 08:14 AM

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

Administrator [Syncfusion]
Replied On February 1, 2007 11:32 AM

Thank you very much. That is what I want.

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

Lan

Administrator [Syncfusion]
Replied On February 1, 2007 12:10 PM

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

Administrator [Syncfusion]
Replied On February 2, 2007 06:45 AM

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

Lan Mo
Replied On February 2, 2007 11:15 AM

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



Administrator [Syncfusion]
Replied On February 5, 2007 07:16 AM

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

Administrator [Syncfusion]
Replied On February 5, 2007 10:33 AM

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

Administrator [Syncfusion]
Replied On February 8, 2007 04:11 AM

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.

Administrator [Syncfusion]
Replied On February 20, 2007 04:36 AM

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


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.

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.

;