Line chart - changing the border width takes up space

I am creating a line chart, and I want to increase the height or thickness of the line without changing the length of the line.

Before increasing the width property, it looks like this:

Chart before altering the width

After increasing the width property, it looks like this:

Chart after altering the width property

I want to increase only the height , but there is no such property for this, so I tried to change the width property. Unfortunately, this increases both length and width . Is there a way to change only height ? If I increase the width , as you can see, the space between the lines disappears.

+4
source share
1 answer

I fixed the problem by removing the start and end caps for the row. When I increased the width of the border, it also increased the width of the start and end caps, which caused strange behavior. Comments in the code below allowed:

 void Form1_Paint(object sender, PaintEventArgs e) { float[] dashValues = { 8, 5, 2, 4 }; Pen blackPen = new Pen(Color.Black, 5); blackPen.DashPattern = dashValues; blackPen.Width = 3; //blackPen.StartCap=LineCap.Round blackPen.StartCap =LineCap.Flat; //blackPen.StartCap=LineCap.Round blackPen.EndCap = LineCap.Flat; e.Graphics.DrawLine(blackPen, new Point(85, 95), new Point(405, 95)); } 
+2
source

All Articles