DataPoints

5 posts, 1 answers
  1. Jeremy
    Jeremy avatar
    7 posts
    Member since:
    May 2014

    Posted 22 May Link to this post

    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.

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 25 May Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jeremy
    Jeremy avatar
    7 posts
    Member since:
    May 2014

    Posted 27 May in reply to Dess Link to this post

    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

  5. Answer
    Dess
    Admin
    Dess avatar
    1609 posts

    Posted 31 May Link to this post

    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.
  6. Jeremy
    Jeremy avatar
    7 posts
    Member since:
    May 2014

    Posted 31 May in reply to Dess Link to this post

    Thanks it worked.

    Thanks for your help

     

    regards

    Jeremy

Back to Top
UI for WinForms is Visual Studio 2017 Ready