简体   繁体   English

Microsoft图表控件:是否标记多个y值和可变y轴?

[英]Microsoft Chart Controls: Label multiple y values and variable y axis?

I am currently using Microsoft Chart Controls to generate a box plot chart. 我目前正在使用Microsoft图表控件生成箱形图。 I have enabled the IsValueShownAsLabel property of the chart's series, but only the first y-value(lower whisker) value is being labeled. 我已启用图表系列的IsValueShownAsLabel属性,但是仅标记了第一个y值(晶须下部)。 Is there a way to enable the labeling of all y-values in the chart? 有没有一种方法可以在图表中标记所有y值?

Also, is there a way to get a different axis for each data point? 另外,是否有办法为每个数据点获得不同的轴? The different data points of the chart are not related when it comes to value ranges, so many data points with small y-values are difficult to read on the chart. 当涉及到值范围时,图表的不同数据点无关,因此许多y值小的数据点很难在图表上读取。 I have currently enabled scrolling as a workaround, but am not satisfied with the result. 我目前已启用滚动作为一种解决方法,但对结果不满意。 I would instead like to have a different y-axis for each data point, so that the y-values for each data point take up the full height of the chart, with the min and max whisker values serving as the y-axis minimum and maximum points. 相反,我希望每个数据点都有不同的y轴,以便每个数据点的y值占据图表的整个高度,而最小和最大晶须值分别作为y轴和最高分。 Is this possible? 这可能吗?

To get different axis you will need to look into the properties under ScaleBreakStyle under AxisY 要获得不同的轴,您需要查看ScaleBreakStyle下ScaleBreakStyle下的属性

Set something like 设置类似

Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.Enabled = true;
Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.BreakLineStyle = Charting.BreakLineStyle.Wave;
// set this to an even lower value if required
Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 15;

Not sure on how to get multiple values but can you try setting those values specifically to the labels in these format #VALY1,#VALY2 depending on the number of Y values available. 不确定如何获取多个值,但是您可以尝试根据可用的Y值的数量将这些值专门设置为#VALY1,#VALY2格式的标签。

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

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