0

I am using Windows Form Data Visualization chart to generate chart and save to images (in memory stream, to be specific). It is required that the horizontal margins must be small. When I set the position and size of the ChartArea, the space for Y axis is small, as required. The labels are sometimes splitted into multiple lines or rotated 45 degrees, which are difficult to read. Is there a way to force them to rotate 90 degrees? The pictures are the examples.

bad example one of the axis is not desired

Thanks in advance.

LLS
  • 2,128
  • 2
  • 23
  • 36

1 Answers1

0

After some search, I found a solution.

chartArea.AxisY.IsLabelAutoFit = false
chartArea.AxisY.LabelStyle.Angle = 90

I will leave it here in case some other people search for the same problem.

The credit goes to another question on StackOverflow

Community
  • 1
  • 1
LLS
  • 2,128
  • 2
  • 23
  • 36