Hello,
is it possible to have different line styles (e.g. dash and solid) on the very same series?
What I'm trying to do is to code additional infomation (data is trustworthy or not) using the line style.
Different colors would be no solutions since there are several lines in one chart.
Hopefully you have an idea,
Marcus
line series with different style
Re: line series with different style
Hello schafma,
Please, check next code works if you want.
I hope will helps.
Thanks,
Is not possible have different line styles for one series. I recommend that do something as next code:is it possible to have different line styles (e.g. dash and solid) on the very same series?
Code: Select all
private Steema.TeeChart.Styles.Line line, line1;
private void Form1_Load(object sender, EventArgs e)
{
line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1.Aspect.View3D = false;
line.FillSampleValues(10);
line1.FillSampleValues(5);
for (int i = 0; i <= (line.Count)/2; i++)
{
line1[i].X = line[i].X;
line1[i].Y = line[i].Y;
}
line.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
line.LinePen.Width = 3;
line1.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Solid;
line1.LinePen.Width = 3;
line1.Color = line.Color;
}
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 with different style
Dear Sandra,
thank you for the idea. I'm not quite sure if this solution is flexible enough for my needs but I'll give it a try.
I had also the idea to use the colors arrays of the line series to assign different alpha values (opacities) to the according line segments.
Once again thank you for your help.
Maybe this feature (different line styles per line segment) will be implemented in a futur release.
Marcus
thank you for the idea. I'm not quite sure if this solution is flexible enough for my needs but I'll give it a try.
I had also the idea to use the colors arrays of the line series to assign different alpha values (opacities) to the according line segments.
Once again thank you for your help.
Maybe this feature (different line styles per line segment) will be implemented in a futur release.
Marcus
Re: line series with different style
Hi Marcus,
Here it is another possibility, maybe more flexible (you could have an array of segments in the line to be discontinuous and check it in the condition into the GetPointerStyle event)
Here it is another possibility, maybe more flexible (you could have an array of segments in the line to be discontinuous and check it in the condition into the GetPointerStyle event)
Code: Select all
Steema.TeeChart.Styles.Line line;
private void InitializeChart()
{
line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1.Aspect.View3D = false;
line.FillSampleValues(10);
line.LinePen.Width = 3;
line.Pointer.Visible = true;
line.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line_GetPointerStyle);
}
void line_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.GetPointerStyleEventArgs e)
{
if ((e.ValueIndex == 3) || (e.ValueIndex == 6)) line.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
else line.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Solid;
e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |