Page 1 of 1

How do I change the colour of an area graph?

Posted: Thu Sep 15, 2011 9:41 am
by 13050364
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);

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

Posted: Thu Sep 15, 2011 11:27 am
by 10050769
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,

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

Posted: Thu Sep 15, 2011 12:25 pm
by 13050364
Hi Sandra

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

Regards

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

Posted: Thu Sep 15, 2011 2:16 pm
by 10050769
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,