This is a migrated thread and some comments may be shown as answers.
DataPoints
4 Answers 71 Views
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 22 May 2016, 05:57 AM

Hi there

How can i change the data point colours?

i have tried

            LineSeries3.BorderColor = Color.Green;
            LineSeries3.BorderColor2 = Color.Green;
            LineSeries3.BorderColor3 = Color.Green;
            LineSeries3.BorderColor4 = Color.Green;
            LineSeries3.ForeColor = Color.Green;

but it changes the line but not the point colour/series colour

i have attached a image showing what i done.

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 May 2016, 11:21 AM
Hello Jeremy,

Thank you for writing. 

In order to change the data points color, you can set the LineSeries.BackColor property:
 
LineSeries lineSeries = new LineSeries();
lineSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jan"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul"));
lineSeries.DataPoints.Add(new CategoricalDataPoint(19, "Oct"));
this.radChartView1.Series.Add(lineSeries);
lineSeries.PointSize = new SizeF(10, 10);
lineSeries.BorderColor = Color.Red;
lineSeries.BackColor = Color.Aqua;

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Jeremy
Top achievements
Rank 1
answered on 27 May 2016, 08:13 AM

Hi Dess

Thanks for that. that worked great.

But its caused my labels to use the same color for the background. i've included screen shot

regards

Jeremy

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 May 2016, 10:21 AM
Hello Jeremy,

Thank you for writing back. 

In order to customize the labels, feel free to use the RadChartView.LabelFormatting event:
private void radChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
{
    e.LabelElement.ForeColor = Color.Lime;
    e.LabelElement.BackColor = Color.White;
    e.LabelElement.BorderColor = Color.Black;
}

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Jeremy
Top achievements
Rank 1
answered on 31 May 2016, 05:19 PM

Thanks it worked.

Thanks for your help

 

regards

Jeremy

Asked by
Jeremy
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Jeremy
Top achievements
Rank 1
Share this question
or