老师,Y轴那边的线别没了,如图
Dim Chart As WinForm.Chart '定义一个图表变量
Chart = Forms("数据大屏").Controls("清洗欠产")' 引用窗口中的图表
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart.ChartType = ChartTypeEnum.Bar '图表类型该为Bar(条形)
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '增加一个图系
Series.Length = 10 '新增图系包括10个数据点
For i As Integer = 0 To 9 '指定每个数据点的位置
Series.X(i) = i '指定水平坐标
Series.Y(i) = i + Rand.Next(5) '垂直坐标用随机数生成
Next
Dim ctl As C1Chart.C1Chart = Chart.BaseControl
ctl.ChartArea.AxisY.Visible = False
ctl.ChartArea.AxisX.Visible = False
Dim t As Table = Tables("表A")'定义一个变量t引用数据表
Chart.DataSource = "表A" '设置绑定表
Series.X.DataField = "线别" 'X轴绑定到产品列
Series.Y.DataField = "完成数量" 'Y轴绑定到数量列
Chart.Inverted = True'XY轴对调
Chart.ColorGeneration = C1Chart.ColorGeneration.Concourse'设置柱形条色系
Chart.VisualEffect = True'设置柱形图样式
Series.DataLabelCompass = LabelCompassEnum.East '柱形图数据位置
Chart.AxisY.GridMajorVisible = False
Chart.AxisX.GridMajorVisible = False
Series.DataLabelText = "{#YVAL}" '条形图数据显示
Series.DataLabelForeColor = Color.FromArgb(57, 222, 222)'字体颜色
Chart.Transparent = True '去掉全部边框,并将全部背景设置为透明
此主题相关图片如下:123.png