Search code examples
asp.netc#-4.0mschart

How to Fix the X Axis values length in Microsoft chart controls


In My sample, I make the X axis to rotate to -90. Now the label values are vertical. Some of the values are huge like "Sample Quotes".

Due to this huge values, My label area is increased and chart area is decreased.

Is it possible to fix the X axis label length in Microsoft chart controls?


Solution

  • I got the answer for this question.

    This is possible by

           MSChart.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.WordWrap;
           MSChart.ChartAreas[0].AxisX.IsLabelAutoFit = true;
    

    Regards, Karthik