Page 1 of 1
Issue with LinePen.Style
Posted: Mon Jun 09, 2014 8:19 am
by 16063571
For LinePen.Style=Dotted,
If bottom axis with is more the dotted line show properly,
if the bottom axis width is less the dotted line is not shown properly , it shown as solid line,
I have attached the Screenshot , please provide the solution to solve the issue
Re: Issue with LinePen.Style
Posted: Mon Jun 09, 2014 9:29 am
by Christopher
gilbert wrote:I have attached the Screenshot , please provide the solution to solve the issue
Using the latest version of TeeChart and the following code:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Line line = new Line(tChart1.Chart);
line.Add(0, 50);
line.Add(10, 50);
tChart1.Axes.Left.SetMinMax(0, 100);
line.LinePen.Width = 3;
line.LinePen.Style = DashStyle.Dash;
}
I get the following chart:
- line1.PNG (6.03 KiB) Viewed 7408 times
this seems to render correctly. Does the above code work for you? Which version of TeeChart are you using?
Re: Issue with LinePen.Style
Posted: Tue Jun 10, 2014 5:36 am
by 16063571
Please add these many points and reduce the width, as shown in the picture
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Line line = new Line(tChart1.Chart);
line.Add(0, 50);
line.Add(0, 50);
line.Add(1, 50);
line.Add(2, 50);
line.Add(3, 50);
line.Add(4, 50);
line.Add(5, 50);
line.Add(6, 50);
line.Add(7, 50);
line.Add(8, 50);
line.Add(9, 50);
line.Add(10, 50);
tChart1.Axes.Left.SetMinMax(0, 100);
line.LinePen.Width = 3;
line.LinePen.Style = DashStyle.Dash;
}
Re: Issue with LinePen.Style
Posted: Thu Jun 12, 2014 1:26 pm
by narcis
Hi gilbert,
Thanks for your feedback.
The difference here is in the number of points that need to be plotted. Christopher Ireland only added two points to the series. A line segment needs to be painted between those 2 points and the segment is long enough to be able to fit the dashed pen. You are adding a much higher number of points within the same X values range and chart width. This means a higher number of point to point segments that need to be painted and that those segments will be much shorter. Therefore, with a narrower chart, there won't be enough space for the segments to be painted as dashed lines as segments overlap. Given that, you can improve that behavior decreasing
LinePen.Width and setting
LinePen.DashCap to
Triangle, for example:
Code: Select all
line.LinePen.Width = 2;
line.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
line.LinePen.DashCap = System.Drawing.Drawing2D.DashCap.Triangle;