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

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

问题描述

我使用MS图表控件在WinForms应用程序,用于显示根据日期值

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

我需要改变x轴标签值(日期)方向horizantal垂直

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

非常感谢....

推荐答案

据我了解你的问题 - 你问如何旋转图表标签垂直显示

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

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

You can rotate the x-axis label as follows:

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

此假设你已经在第一张图区域,使用的WinForms设计师的时候,它是没有修改默认的相关联的系列。

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

下图显示了图将如何code以上应用前,第二图像显示应用code后的显示方式。

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

由于我是新来的,希望建立代表处点,如果我正确地回答了你的问题我会AP preciate它,如果你标记这个问题的回答。谢谢你。

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.

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

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