Change Fast Line Series color

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
netdeveloper
Newbie
Newbie
Posts: 5
Joined: Fri Jun 10, 2016 12:00 am

Change Fast Line Series color

Post by netdeveloper » Wed Sep 07, 2016 6:26 pm

i am unable to change fastline series color its always display in black color
chart intializing code
tChart1.Aspect.View3D = false;
tChart1.Panel.Bevel.Inner = BevelStyles.None;
tChart1.Panel.Bevel.Outer = BevelStyles.None;
// getAxes().getBottom().scroll(3, false);

Graphics3DDirect2D D2D = new Graphics3DDirect2D(tChart1.Chart);
D2D.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
D2D.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

tChart1.Graphics3D = D2D;
tChart1.Graphics3D.BufferStyle = BufferStyle.None;
// tChart1.Graphics3D.UseBuffer = true;
tChart1.Axes.Bottom.Grid.Visible = false;//.BottomAxis.Grid.Visible

////adding series like this

ChartPen p = new ChartPen();
p.Width = 2;
p.DrawingPen.Color = Color.Red;
series = tChart1.Series.Add(new Steema.TeeChart.Styles.FastLine() { LinePen = p, Color = Color.Red});
but it always rendering as balck????any idea how to resolve this issue

Thankyou

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Change Fast Line Series color

Post by Christopher » Thu Sep 08, 2016 9:00 am

Hello,

The issue here is about when the FastLine series is added to the Series collection, e.g.

Code: Select all

    private void InitializeChart()
    {
      ChartPen pen = new ChartPen();
      pen.Color = Color.Purple;

      FastLine fastLine = new FastLine();
      tChart1.Series.Add(fastLine);
      fastLine.LinePen = pen;
      fastLine.FillSampleValues();
      //tChart1.Series.Add(fastLine); //not okay here
    }
when a Series is added to the Series collection it's color is modified under some circumstances - to use the custom ChartPen, simply add the FastLine series to the collection before setting the Pen.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply