Page 1 of 1

Change Fast Line Series color

Posted: Wed Sep 07, 2016 6:26 pm
by 15678498
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

Re: Change Fast Line Series color

Posted: Thu Sep 08, 2016 9:00 am
by Christopher
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.