简体   繁体   English

Windows图表在X上的点的C#自动标注

[英]Windows Charts Forms C# Auto labeling of the points on X

I'm having some issues with Windows charts and the points displayed on the x-axis. Windows图表和X轴上显示的点存在一些问题。

I have two plots of data in a line chart based upon set data points, eg 200,400,600,800,1000. 我基于设置的数据点(例如200,400,600,800,1000)在折线图中有两个数据图。 I also use a 3rd & 4th series to colour areas depending which line is higher. 我还使用第三和第四系列对区域进行着色,具体取决于哪条线较高。 To do this I've had to add extra points where the two lines intersect. 为此,我不得不在两条线相交处添加额外的点。 This then throws out the labels on the x axis as the chart automatically labels the points something odd such as: 然后,这会抛出x轴上的标签,因为图表会自动为一些奇怪的点添加标签,例如:

| |
| |
| |
| |

========================= ========================
120......370.....590.....730......850 120 ...... 370 ..... 590 ..... 730 ...... 850

Is there a way I can explicitly specify the datapoints on the axis that I want to use, other than the min-maximum value function? 除了min-maximum值函数以外,是否有其他方法可以明确指定要使用的轴上的数据点?

So you want to customize the X axis labels to match your data? 因此,您想自定义X轴标签以匹配您的数据吗? If so you can define custom labels and a customize event to do that. 如果是这样,您可以定义自定义标签和一个自定义事件。 This was posted on StackOverflow by the user Somebody 这由用户Somebody发布在StackOverflow上

How to set values in x axis MSChart using C# 如何使用C#在X轴MSChart中设置值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM