This is a migrated thread and some comments may be shown as answers.

Setting PointMark's color to auto-generated line color.

1 Answer 32 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 2
Sean asked on 02 Dec 2010, 11:34 PM
Hi,

I generate a line graph. I do not define the series' color. When the series appears it has a color (presumably just assigned a default/random). I would like to have my series' pointmark be this color.

I tried:

series.Appearance.PointMark.FillStyle.MainColor = series.Appearance.LineSeriesAppearance.Color;

This does not work because the color is still define as ARGB 0,0,0 at the time of PageLoad.

How would I fix this issue?

1 Answer, 1 is accepted

Sort by
0
Accepted
Evgeni "Zammy" Petrov
Telerik team
answered on 07 Dec 2010, 03:29 PM
Hello Sean,

 You can execute this logic on BeforeLayout of the chart.

protected void Page_Load(object sender, EventArgs e)
{
    ...
    RadChart1.BeforeLayout += new EventHandler<EventArgs>(RadChart1_BeforeLayout);
    ...
}
void RadChart1_BeforeLayout(object sender, EventArgs e)
{
    Color c = RadChart1.Series[0].Appearance.LineSeriesAppearance.Color;
    RadChart1.Series[1].Appearance.PointMark.FillStyle.MainColor = c;
}

Do not hesitate to contact if this does not work out.

 

Best wishes,
Evgeni "Zammy" Petrov
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Chart (Obsolete)
Asked by
Sean
Top achievements
Rank 2
Answers by
Evgeni "Zammy" Petrov
Telerik team
Share this question
or