圖表為箱線圖(盒須圖),代碼已可正常顯示圖表。
目前3個問題請教大神:
1、圖表如何顯示value labe。要求顯示:最大值、最小值、均值、例外值的value labe。目前顯示的情況如圖1
2、series1,series2,series3,中設定的AxisLabel 無法顯示到圖表中

下面為部分代碼
Chart1.ChartAreas.Clear()
Dim ChartAreas1 As New ChartArea(SeriesName) '定義新的ChartArea
Chart1.ChartAreas.Add(ChartAreas1) '將新定義的ChartArea加入Chart1
Chart1.ChartAreas(0).AxisX.Title = ExcelDataSet0.Tables(0).TableName '設定ChartArea里坐標軸標題
Chart1.ChartAreas(0).AxisY.Title = SeriesName
Chart1.ChartAreas(0).AxisY.Minimum = y_Min
Chart1.ChartAreas(0).AxisY.Maximum = y_Max
Chart1.ChartAreas(0).AxisY.Interval = FormatNumber((y_Max - y_Min) / 6, 4) ' 坐標軸上相鄰數值的間隔大小
Chart1.Series.Clear()
boxPlotSeries = New Series() With {
.Name = LimiteValue,
.ChartType = SeriesChartType.BoxPlot,
.AxisLabel = "PN1W7910_Rm", '問題:這里設定 AxisLabel 可反應到圖表的x軸,但3組資料的命名都會被修改。
.IsValueShownAsLabel = True} '問題:這里設定 IsValueShownAsLabel ,無法讓圖表顯示所有labe數值
boxPlotSeries("BoxPlotSeries") = “1;2;3”
boxPlotSeries("BoxPlotShowAverage") = "True"
boxPlotSeries("BoxPlotShowMedian") = "True"
boxPlotSeries("BoxPlotShowUnusualValues") = "True"
series1 = New Series() With {
.Name = "1",
.Enabled = False,
.AxisLabel = "PN1W7910_Rm"} '問題:series1,series2,series3,中設定的AxisLabel 無法顯示到圖表中
series1.Points.DataBindY(yy1)
series2 = New Series() With {
.Name ="2",
.Enabled = False,
.AxisLabel = "PN1W7911_Rm"}
series2.Points.DataBindY(yy2)
series3 = New Series() With {
.Name = "3",
.Enabled = False,
.AxisLabel = "PN1W7912_Rm"}
series3.Points.DataBindY(yy3)
Chart1.Series.Add(boxPlotSeries)
Chart1.Series.Add(series1)
Chart1.Series.Add(series2)
Chart1.Series.Add(series3)
另外我在網上查資料,發現個“y值索引”不知道是什么,如何呼叫?
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/53936.html
標籤:VB.NET
