Dim sps As List(of String) = DataTables("chart_values").GetValues("ScorePart","[bankCode] = \'" & MainCode & "\' And [ScorePart] Is Not NULL")
Dim fs As String = "[BankCode] = \'" & MainCode & "\' And [Year] = \'" & crtYear & "\' And [Quarter] = \'" & crtQuarter & "\' And [RoleCode] = \'" & crtRole & "\'"
For Each sp As String In sps \'A/B表
Dim Chart As WinForm.Chart
Dim Series As WinForm.ChartSeries
Chart = e.Form.Controls("Chart" & sp)
\'Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.Bar
Chart.ChartType2 = ChartTypeEnum.XYPlot
Chart.SeriesList.Clear()
Chart.SeriesList2.Clear()
Dim drl As List(of DataRow)
drl = DataTables("chart_values").Select(fs & " And [ScorePart] = \'" & sp & "\'","LossRate DESC")
If drl.Count > 0 Then
Series = Chart.SeriesList.Add()
Series.Length = drl.Count
For i As Integer = 0 To Series.Length - 1
Series.X(i) = i
Series.Y(i) = Math.Round(drl(i)("LossRate") * 100,2)
Next
Series.DataLabelText = "{#YVAL}" & "%"
Series.Text = "分项失分率"
Chart.LegendCompass= CompassEnum.North
Chart.AxisX.AnnoRotation = - 30
Chart.AxisX.AnnoWithLabels = True
Series = Chart.SeriesList2.Add()
Series.Length = drl.Count
For i As Integer = 0 To Series.Length - 1
Series.X(i) = i
Series.Y(i) = Math.Round(drl(i)("Perception") * 100,2)
\'Chart.AxisX.SetValueLabel(i,drl(i)("Name"))
Next
Chart.LegendVisible = True \'显示图列
Series.DataLabelText = "{#YVAL}" & "%"
Series.Text = "累积百分比"
For i As Integer = 0 To Series.Length - 1
Chart.AxisX.SetValueLabel(i,drl(i)("Name"))
Next
End If
Next