如何在ms图表中改变X轴标签的方向 [英] how to change the direction of X-axis label in ms charts

查看:454
本文介绍了如何在ms图表中改变X轴标签的方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我在winforms应用程序中使用Ms图表控件以根据日期显示值



我需要将x轴标签值(日期)更改为horizantal垂直



我搜索过这么多属性,但我没有找到任何解决方案。



我对这个问题





很感谢....

解决方案

- 您正在询问如何旋转图表标签以垂直显示。



您可以按如下方式旋转x轴标签:

  chart1.ChartAreas [0] .AxisX.LabelStyle.Angle = -90; 

这假设您已将系列与第一个图表区域相关联,这是默认的, Winforms设计器。



下面的图片显示了在应用上面的代码之前图表的外观,第二个图片显示了在应用代码之后它是如何显示的。 p>

让我知道如果这不是你想做的,我会发布更新的答案。



旋转



旋转后

>



由于我是新来的,并希望建立重现点,如果我已经正确回答了你的问题,我将不胜感激,如果你将这个问题标记为回答。谢谢。


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 horizantal to vertical

I have searched so many properties but i did not find any solution for this.

Any one help me on this problem

Many Thanks ....

解决方案

As I understand your question - you are asking how to rotate the chart label to display vertically.

You can rotate the x-axis label as follows:

chart1.ChartAreas[0].AxisX.LabelStyle.Angle = -90;

This assumes you have associated your series with the first chart area, which is the default without modification when using the Winforms designer.

The following images shows how the chart would look before the code above is applied, the second image shows how it appears after the code is applied.

Let me know if this is not what you are trying to do and I will post an updated answer.

Before rotation

After Rotation

As I am new here and looking to build up rep points, if I have answered your question correctly I would appreciate it if you mark this question as answered. Thank you.

这篇关于如何在ms图表中改变X轴标签的方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆