Page 1 of 1

How to change the color of a line series?

Posted: Wed Mar 12, 2014 2:37 am
by 17365127
Hi, I'm using Xamarin to build an android project.
I have one chart with two series, line and volume, but only the color of volume can be changed by following code.

Code: Select all

line1.LinePen.Color = Color.Yellow;

volume1.LinePen.Color = Color.MediumOrchid;
Please help!

Re: How to change the color of a line series?

Posted: Wed Mar 12, 2014 9:40 am
by narcis
Hi benlu,

That's because Line series has two elements from which you can change the color: pen and brush. In a 3D chart both of them are visible so you need to set brush color this way:

Code: Select all

      line1.LinePen.Color = Color.Yellow;
      line1.Brush.Color = line1.LinePen.Color;
or this:

Code: Select all

      line1.Color = Color.Yellow;