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

Thread is closed for posting
2 posts, 1 answers
  1. Sean
    Sean avatar
    200 posts
    Member since:
    Nov 2010

    Posted 02 Dec 2010 Link to this post


    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?

  2. Answer
    Evgeni "Zammy" Petrov
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 07 Dec 2010 Link to this post

    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.
Back to Top