Custom Legend for Histogram
Posted: Thu Mar 28, 2013 9:14 am
I am using the Histogram Series to display some data and I am assigning a color value to each data point depending on its value.
Now I would like to see these colors in the histogram legend. If I use LegendStyles.Values the legend is far too long. Is it possible to remove any duplicates from the legends? Since my data contains a max. of 7 different values, I only want those 7 values to appear in the histogram legend.
Regards,
Tabina
Code: Select all
this.TChart = new TChart();
this.Series = new Steema.TeeChart.WPF.Styles.Histogram(this.TChart.Chart);
// set the histogram's datasource to content
for (int i = 0; i < src.Content.Length; i++)
{
int value= src.Content[i];
//get the color for the value
Color col = ValueColorMapping[value];
this.Series.Add(i, value, col);
}
// add the histogram to the series list
this.TChart.Series.Add(this.Series);
Regards,
Tabina