TeeChart version 4.1.2012.9210
ColorEachLine = false only seems to work when Pointer is visible.
Line series ColorEachLine not working
Re: Line series ColorEachLine not working
Hello diegoa,
If you want apply colorEach property to your line, you must do next:
Could you tell us if previous line of code help you?
I hope will helps.
Thanks,
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,
Best Regards,
Sandra Pazos / 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 |
Re: Line series ColorEachLine not working
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.
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.
- Attachments
-
- WindowsFormsApplication10.zip
- (18.58 KiB) Downloaded 420 times
Re: Line series ColorEachLine not working
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.
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
Hello diegoa,
Thanks,
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.But it seems setting ColorEachLine = false; only works when line1.Pointers.Visible is true.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Line series ColorEachLine not working
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.When you draw a color for each point, the different segments are painted by default with same color of pointers
Re: Line series ColorEachLine not working
Hello diegoa,
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:
I hope will helps.
Thanks,
Good. Your code is next: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.
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);
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;
}
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Line series ColorEachLine not working
Thanks for the example.