Page 1 of 1

Line series ColorEachLine not working

Posted: Mon Jan 14, 2013 8:03 am
by 15663510
TeeChart version 4.1.2012.9210

ColorEachLine = false only seems to work when Pointer is visible.

Re: Line series ColorEachLine not working

Posted: Mon Jan 14, 2013 4:13 pm
by 10050769
Hello diegoa,

If you want apply colorEach property to your line, you must do next:

Code: Select all

  line1.ColorEach = true;

Could you tell us if previous line of code help you?

I hope will helps.

Thanks,

Re: Line series ColorEachLine not working

Posted: Tue Jan 15, 2013 9:23 am
by 15663510
Nope.

I am using TeeChart version 4.1.2012.9210.

In the example I click Fetch and if Pointers is not checked and I click ColorEachLine off or ColorEach, the colors lines still show which is a problem for me. When I click Pointers with ColorEachLine off, then it doesn’t show the color lines which is fine.

Re: Line series ColorEachLine not working

Posted: Tue Jan 15, 2013 1:15 pm
by 15663510
I have no need to use ColorEach property.

All I want to do is to turn off the different color lines on a line series using ColorEachLine = false;

But it seems setting ColorEachLine = false; only works when line1.Pointers.Visible is true.

Re: Line series ColorEachLine not working

Posted: Wed Jan 16, 2013 10:03 am
by 10050769
Hello diegoa,
But it seems setting ColorEachLine = false; only works when line1.Pointers.Visible is true.
As you have said ColorEachLine = false; only works when line1.Pointers.Visible is true. You must know that when you assign colors for each point, ColorEach property doesn't work, because it only work if you don't define the points colors, e.g. automatic color. When you draw a color for each point, the different segments are painted by default with same color of pointers. If you want the Line Series doesn't have same color of pointer, you only need set ColorechaLine property to false, always pointers of Series are visible.

Thanks,

Re: Line series ColorEachLine not working

Posted: Thu Jan 17, 2013 10:49 am
by 15663510
When you draw a color for each point, the different segments are painted by default with same color of pointers
So there is currently no way to turn this off default as you mentioned above when points (rectangles on the graph) are not visible. This is a big requirement from our clients.

Re: Line series ColorEachLine not working

Posted: Thu Jan 17, 2013 4:04 pm
by 10050769
Hello diegoa,
So there is currently no way to turn this off default as you mentioned above when points (rectangles on the graph) are not visible. This is a big requirement from our clients.
Good. Your code is next:

Code: Select all

 line1.Add(1, 1, Color.Blue);
            line1.Add(2, 1000, Color.Gray);
            line1.Add(3, 20, Color.Blue);
            line1.Add(4, 50, Color.Blue);
            line1.Add(5, 1000, Color.Gray);
            line1.Add(6, 56, Color.Blue);
            line1.Add(7, 23, Color.Blue);
            line1.Add(8, 22, Color.Blue);
As you see, your code assigns for each point(segment) a determinate color, if you do it, you can't use Coloreach, because you don't work with automatic colors and the line color is the color you assign. For this reason, if you want achieve change the pointer color, but you keep one color of the line. I recommend do something as next:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            checkBox1.Checked = false;
            checkBox2.Checked = false;
        }
        
        private void button1_Click(object sender, EventArgs e)
        {
            line1.Clear();
            line1.Add(1, 1);// Color.Blue);
            line1.Add(2, 1000);//Color.Gray);
            line1.Add(3, 20);// Color.Blue);
            line1.Add(4, 50);// Color.Blue);
            line1.Add(5, 1000);// Color.Gray);
            line1.Add(6, 56);// Color.Blue);
            line1.Add(7, 23);//Color.Blue);
            line1.Add(8, 22);//Color.Blue);
          //  tChart1.Draw();
            line1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line1_GetPointerStyle);
            line1.ColorEach = false;
            line1.ColorEachLine = false;

        }

        void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
        {
            if (line1[e.ValueIndex].X == 1)
            {
                e.Color = Color.Blue;
            }
            else if(line1[e.ValueIndex].X==2)
            {
                e.Color = Color.Gray;
            }
            else if(line1[e.ValueIndex].X==3)
            {
                e.Color = Color.Blue;
            }
            else if(line1[e.ValueIndex].X==4)
            {
                e.Color = Color.Blue;
            }
            else if(line1[e.ValueIndex].X==5)
            {
                e.Color = Color.Gray;    
            }
            else if(line1[e.ValueIndex].X==6)
            {
                e.Color = Color.Blue;
            }
            else if (line1[e.ValueIndex].X == 7)
            {
                e.Color = Color.Blue;
            }
            else if (line1[e.ValueIndex].X == 8)
            {
                e.Color = Color.Blue;
            }
        }
I hope will helps.

Thanks,

Re: Line series ColorEachLine not working

Posted: Fri Jan 18, 2013 5:47 am
by 15663510
Thanks for the example.