Imagine I have a line serie with values in 1, 2, 3 and 4 of the x axis. By example, could I (in any way) not to draw the line between the second and third points?
Thanks in advance
Don't draw the serie between 2 points
Re: Don't draw the serie between 2 points
Hi wakeup,
First of all, note that as we consider that a line is the union of two points, if you hide one of these points, no line should be drawn. So, if you hide, for example, the point 3, you'll loose the segments 2-3 and 3-4.
If you want to hide the segment 2-3 you could add another point 2', somewhere between 2 and 3, and hide it.
Here is an example:
First of all, note that as we consider that a line is the union of two points, if you hide one of these points, no line should be drawn. So, if you hide, for example, the point 3, you'll loose the segments 2-3 and 3-4.
If you want to hide the segment 2-3 you could add another point 2', somewhere between 2 and 3, and hide it.
Here is an example:
Code: Select all
private Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.Pointer.Visible = true;
line1.FillSampleValues(6);
tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
}
void tChart1_DoubleClick(object sender, EventArgs e)
{
if (line1.Count == 6)
line1.Add(2, 0, Color.Transparent);
else
line1.Delete(3);
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Don't draw the serie between 2 points
Thanks your example is just that I need. But in my case the x axis are dates and that trick doesn't run properly with datetimes.
You can test in your example addin the line "line1.XValues.DateTime = true;"
Thanks
You can test in your example addin the line "line1.XValues.DateTime = true;"
Thanks
Re: Don't draw the serie between 2 points
Hi wakeup!
Note that when in the example above I added a point in the same position than the third point, I've added it directly with it's XValue (2) to make the transparent point to be located at the desired position.
When you have datetimes in the X values, the third point value isn't 2, but you can get the third value with XValues[2]:
Note that when in the example above I added a point in the same position than the third point, I've added it directly with it's XValue (2) to make the transparent point to be located at the desired position.
When you have datetimes in the X values, the third point value isn't 2, but you can get the third value with XValues[2]:
Code: Select all
void tChart1_DoubleClick(object sender, EventArgs e)
{
if (line1.Count == 6)
line1.Add(line1.XValues[2], 0, Color.Transparent);
else
line1.Delete(3);
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Don't draw the serie between 2 points
Nice!
Thanks!
Thanks!