Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1532
  • Last Modified:

dashed lines in chart become solid if points are close together

Hello,
I am using the Microsoft chart control in visual studio 2010 on a Windows application. When I set the property to select the line style to dashed, it works, but if the line segment between data points is smaller than the dash length, the line restarts at each point and effectively becomes a solid line.

                var series = chart1.Series.Add(TagGroup);
                series.BorderDashStyle = ChartDashStyle.Dash;

Is there a way around this?
0
cgammans
Asked:
cgammans
  • 3
  • 2
1 Solution
 
AndyAinscowCommented:
>>Is there a way around this?

Use less data points?
0
 
cgammansAuthor Commented:
Unfortunately that is not an option.
0
 
AndyAinscowCommented:
Change style to dots - or put up with the current behaviour.  :-(
0
 
cgammansAuthor Commented:
The requirements are that the user must be able to select between line types of solid, dots, dash, dot-dash.

I will look around at other chart controls.

I may also have to try to catch the onPaint event for each line segment and adjust the pen that is used. I believe the pen is based off of an array of floats that can set the Dashpattern property of the line.

If I keep track of the line segments as they are drawn, I can adjust the dashpattern array so that it doesn't just start over again from the beginning at each segment. That will give it a smooth pattern, even around multiple segments.

I was hoping it would be easier though. But apparently I'll have to give this a try.

I am creating a chart control which is inherited from the MS Chart control and then trying to find how to get at the OnPaint event for each segment.

Any ideas?
0
 
cgammansAuthor Commented:
I'll live with it for now.

1) If the line thickness is small, then the problem is not as bad.

2) I've added zooming to the chart, so in places where the problem exists, they can zoom in for clarification.

I put the problem on a back burner then demo'ed it to the client and they were OK for now.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now