wakewakeup wrote:Isn't there any way to set the color of the line and de point independently?
Yes, you can set the global line and point colors like this:
Code: Select all
line1.Color = Color.Green;
line1.Pointer.Color = Color.Yellow;
The way to set *single* point color/characteristics rather than global point color/characteristics independently from the line is to use the GetPointerStyle event, which is what it was designed for.
wakewakeup wrote:But still I don't find an easy way to put in red points which not have the previous and neither the next red so I don't want to have red line...
I'm not sure I follow you here - to set a single point color without modifying the line color you can use:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Line line1 = new Line(tChart1.Chart);
line1.Pointer.Visible = true;
line1.Add(new DateTime(2016, 1, 1), 1);
line1.Add(new DateTime(2016, 2, 1), 2);
line1.Add(new DateTime(2016, 3, 1), 3);
line1.Add(new DateTime(2016, 4, 1), 4);
line1.Add(new DateTime(2016, 5, 1), 5);
line1.GetPointerStyle += Line1_GetPointerStyle;
}
private void Line1_GetPointerStyle(CustomPoint series, GetPointerStyleEventArgs e)
{
if (e.ValueIndex == 2)
{
e.Color = Color.Red;
}
}