how to change the direction of X-axis label in ms charts

前端 未结 2 509
花落未央
花落未央 2021-01-02 14:07

Hi I am using Ms chart control in winforms application for displaying values according to dates

I need to change the x-axis label values(Dates) direction horizan

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-02 14:58

    If you have not already done so, get the chart samples from microsoft:
    http://archive.msdn.microsoft.com/mschart

    Then check the section on Labels
    Chart Features > Labels

    To answer your question directly, set the angle in LabelStyle, and don't forget to disable autofit

    chartArea1.AxisX.IsLabelAutoFit = false;
    chartArea1.AxisX.LabelStyle.Angle = 90;
    

提交回复
热议问题