'Dim dt As Date = Date.Today
'Dim y As Object = Format(dt,"yyyy")
'Dim m As Object = Format(dt,"MM")
'
''Dim filter As Object = y & "-" & Format(m,"00") & ""
'Dim filter As Object = y & "-" & m
'DataTables("月度统计").loadFilter = "年月 = '" & filter & "'"
'DataTables("月度统计").load()
'DataTables("月度统计").DataCols("年月").RaiseDataColchanged()
'DataTables("月度统计").DataCols("上月").RaiseDataColchanged()
'
'DataTables("月度统计").save
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.ChartType = ChartTypeEnum.Bar '条形
'Chart.DataSource = "月度统计" '设置绑定表
Chart.AxisY.Min = 0 '指定Y轴的最小值
'Chart.DataFilter = Tables("月度统计").Filter
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '增加一个图系
Series.Length = 8
Dim r As Row = Tables("月度统计").Current
For i As Integer = 2 To 9
Series.X(i-2) = i-2
Series.Y(i-2) = r(Tables("月度统计").Cols(i).Name )
Next
For j As Integer = 2 To 9
Chart.AxisX.SetValueLabel(j-2, Tables("月度统计").Cols(j).Name) '指定字符表示
Next
Chart.AxisX.AnnoRotation = - 45
Series.DataLabelText = "{#YVAL}" '数据标示
Series.DataLabelCompass = LabelCompassEnum.North '标示显示位置
'Series.FillColor = Color.Red '图状颜色填充
Series.DataLabelForeColor = Color.White '标示字体白字
Series.Text = r("年月")
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端
Dim fnt As New Font("微软雅黑",18,FontStyle.Bold) '标题大小和字体
Chart.AxisX.Font = fnt
Chart.Font = new font("微软雅黑",15,FontStyle.Bold) '设置图表字体大小X轴加粗有用(图例和标示字体大小)
'...................面板颜色边框................
Dim b As C1.Win.C1Chart.C1Chart = e.Form.Controls("Chart1").BaseControl
b.BackColor = Color.White '图板外颜色White
b.ChartArea.Style.BackColor = Color.White '图板内颜色White
b.ChartArea.Style.Border.BorderStyle = 0 '图板外形框线型
b.ChartArea.Style.GradientStyle = 0 '图板外形框样式
Chart.BackColor = System.Drawing.Color.black '图表本身黑色
Dim ct0l = Chart.BaseControl
ct0l.ChartArea.Style.Opaque = False
ct0l.Style.Border.BorderStyle = C1.Win.C1Chart.BorderStyleEnum.None
ct0l.ChartArea.Style.Border.BorderStyle = C1.Win.C1Chart.BorderStyleEnum.None
Chart.BarClusterWidth = 80 '图例宽度
Dim gd As C1Chart.C1Chart = Chart.BaseControl
gd.ChartArea.AxisX.ScrollBar.min =-0.5
gd.ChartArea.AxisX.ScrollBar.Scale = 10 / Tables("月度统计").Rows.count
Chart.ForeColor = Color.Gold '下标题+标示文字颜色+图形框颜色
Chart.AxisX.AnnoWithLabels = True '启用字符标示