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

Need PointMark filltype to be solid

3 Answers 44 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
PJ Melies
Top achievements
Rank 1
PJ Melies asked on 27 Oct 2008, 10:44 PM
We have a line chart build programmatically.  I cannot get the PointMarks to be filled in.  I've set the PointMark border successfully but inside the border is not filled in.  I would expect the point marks to be filled in with the same color as the series line.
Here's the relevant sample code:

ChartSeries series =

new ChartSeries(someName, ChartSeriesType.Line);
series.Appearance.PointMark.Visible = true;
series.Appearance.PointMark.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
series.Appearance.PointMark.Border.Width = 1;
series.Appearance.PointMark.Border.Color = System.Drawing.Color.Black;
radChartDateRangeView.Series.Add(series);

 

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 28 Oct 2008, 07:04 AM
Hello PJ Melies,

You have just one line to add -- set the color of the point mark like this:
RadChart1.Series[0].Appearance.PointMark.FillStyle.MainColor = System.Drawing.Color.Red;

Hope this helps.

Sincerely,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
PJ Melies
Top achievements
Rank 1
answered on 28 Oct 2008, 03:52 PM
That works if I want all of the point marks on all of the series lines to be the same.  In my case there are an unknown number of series at design time and I would like the color of the point mark to match the color of the chart line.  Is there a way for me to specify that the point mark FillStyle MainColor be the same as the series line it belongs to?  I tried the following code but the LineSeriesAppearance.Color wasn't set.

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

0
Accepted
Ves
Telerik team
answered on 29 Oct 2008, 08:04 AM
Hello PJ Melies,

This color will be set in PrePaint event handler. You can use the following code to achieve your goal:

    protected void RadChart1_PrePaint(object sender, EventArgs e) 
    { 
        foreach (ChartSeries series in RadChart1.Series) 
        { 
            series.Appearance.PointMark.Visible = true
            foreach (ChartSeriesItem item in series.Items) 
            { 
                item.PointAppearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; 
                item.PointAppearance.FillStyle.MainColor = series.Appearance.LineSeriesAppearance.Color; 
            } 
        } 
    } 

Hope this helps.

Sincerely,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
PJ Melies
Top achievements
Rank 1
Answers by
Ves
Telerik team
PJ Melies
Top achievements
Rank 1
Share this question
or