Page 1 of 1
trendfunction change color 1 point (the last)
Posted: Mon Mar 01, 2010 1:05 pm
by 8122357
Hello,
Is there a way to change the color of one point in a values of the trendline?
regards,
Marc
Re: trendfunction change color 1 point (the last)
Posted: Mon Mar 01, 2010 3:06 pm
by yeray
Hi Marc,
Have you tried with the line series' GetPointerStyle event? The following code works fine for me here:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Steema.TeeChart.Styles.Area area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
area1.FillSampleValues();
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Functions.TrendFunction trend1 = new Steema.TeeChart.Functions.TrendFunction();
line1.Function = trend1;
line1.DataSource = area1;
line1.Pointer.Visible = true;
line1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line1_GetPointerStyle);
}
void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
if (e.ValueIndex == series.Count-1) e.Color = Color.Red;
}