How do I change the colour of an area graph?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

How do I change the colour of an area graph?

Post by Dave » Thu Sep 15, 2011 9:41 am

Again Sorry I this is a basic but its not obvious how to do this.
Im now creating an area chart (see code snippet below).
Ive tried setting the colour to red but it reamins at blue which I assume is the default.
Does anyone know how I change the colour to red?

The TeeChart version we have is 3.5.3371.26406

Thanks.

=======================================

Area areaGraph = new Area();
areaGraph.AreaBrush.Color = Color.Red;
areaGraph.Add(x, theValues);
histogramChart.Series.Add(areaGraph);

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How do I change the colour of an area graph?

Post by Sandra » Thu Sep 15, 2011 11:27 am

Hello Dave,

I have made a little change in your code and now works fine. You only need change areaGraph.AreaBrush.Color=Color.Red to areaGraph.Color = Color.Red, see next lines of code:

Code: Select all

     
         private void InitializeChart()
        {
            Area areaGraph = new Area();
            areaGraph.Color = Color.Red;
            areaGraph.FillSampleValues();
            tChart1.Series.Add(areaGraph); 
       }
Can you tell us if previous code works as you expected?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: How do I change the colour of an area graph?

Post by Dave » Thu Sep 15, 2011 12:25 pm

Hi Sandra

No that doesn't work. The colour is still blue

Regards

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: How do I change the colour of an area graph?

Post by Sandra » Thu Sep 15, 2011 2:16 pm

Hello Dave,

I have I realized that you are using build 3.5.3371.26406 instead of last release of TeeChart.Net version 3( build 3.5.3700.30575) with I've used to do the test. Please can you update your version 3 and try again if your problem persist?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply