简体   繁体   中英

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

I am currently using Microsoft Chart Controls to generate a box plot chart. I have enabled the IsValueShownAsLabel property of the chart's series, but only the first y-value(lower whisker) value is being labeled. Is there a way to enable the labeling of all y-values in the chart?

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. 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. Is this possible?

To get different axis you will need to look into the properties under ScaleBreakStyle under AxisY

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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