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.

custom legend

Thread ID:

Created:

Updated:

Platform:

Replies:

68310 Sep 17,2007 03:12 PM Oct 6,2007 04:44 AM Windows Forms 5
loading
Tags: Chart
Kamen Yotov
Asked On September 17, 2007 03:12 PM

what is the easiest way for me to render a completely custom legend, hopefully reusing some elements of the existing one where necessary... (e.g. the icon/representation).

thanks,

Administrator [Syncfusion]
Replied On September 24, 2007 05:10 AM

Hi Kamen,

Thank you for using Syncfusion products.

Please refer the following customizations available for chart legend.

1) The appearance of the Chart Legend in Essential Chart can be customized through various properties exposed by the ChartControl’s ChartLegend object.

2) The symbol of the legend can also be easily customized to have any shape of the user’s choice using the RepresentationType property of the ChartLegend class.

[C#]
this.chartControl1.Legend.RepresentationType = ChartLegendRepresentationType.Circle;

3) The series-legend that is being displayed next to each data point in a series, can be customized with respect to Size, Style, Color etc. using the various properties supported by corresponding ChartSeries Style.

[C#]
foreach (ChartSeriesLegendItem item in this.chartControl1.Legend.Items)
{
item.Series.Style.Font.Facename = fontname;
}
this.chartControl1.Refresh();

4) ChartLegendFilterItems Event handler is used to change the collection of Legend Items that the legend renders.

5) The chart legend can be positioned easily anywhere in the ChartControl. The position of the chart legend can be changed by using Position property of the ChartLegend class.

[C#]
this.chartControl1.LegendPosition = ChartDock.Left;

6) The items of chart legend can be displayed in multiple rows and columns by adjusting the RowsCount/ColumnsCount properties of the ChartLegend class.

[C#]
this.chartControl1.Legend.RowsCount = 1; this.chartControl1.Legend.ColumnsCount = 2;

Please refer sample for above said features in the below location.

[Install drive]:\Documents and Settings\USERNAME\My documents\ Syncfusion \..\Chart.Windows\Samples\2.0\Chart Legend\ChartLegend

Can you please elaborate on reuse mechanism in customizing the chart legend?

Also please let me know if you have any other queries.

Regards,
Jaya

Kamen Yotov
Replied On September 25, 2007 09:37 AM

Thanks for replying.

I need to render a completely custom legend, as I believe what I need is not supported in the ChartLegend properties...

For example, I need to render the legened as a table, where the columns represent different statistics for the series... see attached mock-up.

I am close to deciding to tell the chart not to show a legend and then use essential grid to render a custom legend below the chart, but i wanted to ping your opinion.

thanks!

image.zip

Administrator [Syncfusion]
Replied On October 2, 2007 01:58 PM

Hi Kamen,

Thanks for the update.

To achieve your requirement you can embed Essential Grid on the Chartcontrol since ChartLegend is rendered as an image, you cannot display statistics information in ChartLegend.

Please let me know if you have any other queries.

Regards,
Jaya

Kamen Yotov
Replied On October 5, 2007 12:14 PM

I did exactly that -- used a grid, but I did not embed it in the chart control... I just put it below the chart as a separate control. What do you mean by embed? Is there a way to integrate it more tightly, so that e.g. I can drag it around like the original legend?

Administrator [Syncfusion]
Replied On October 6, 2007 04:44 AM

Hi Kamen,

Thanks for the update.

You can place GridControl over the ChartControl. But you cannot integrate tightly with GridControl. Sorry if I was not clear to you.

Please let us know if you require any further assistance.

Regards,
Jaya

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.

;