(6个数据只标示了5个数据,请帮检查指导一下)
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.VisualEffect = True '加上这一行,让你的图表更漂亮
Chart.ChartType = ChartTypeEnum.Bar '图表类型该为Bar(条形)
Chart.DataSource = "项目管理公司项目成本报表"'设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '增加第一个图系
Series.Text ="目标成本_计划总成本_人工费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField ="目标成本_计划总成本_人工费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "开工至今累计_实际成本_人工费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField = "开工至今累计_实际成本_人工费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "目标成本_计划总成本_材料费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField = "目标成本_计划总成本_材料费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "开工至今累计_实际成本_材料费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField = "开工至今累计_实际成本_材料费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "目标成本_计划总成本_机械费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField = "目标成本_计划总成本_机械费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Series = Chart.SeriesList.Add() '增加第二个图系
Series.Text = "开工至今累计_实际成本_机械费占比"
Series.X.DataField = "工程名称简称"'X轴绑定到产品列
Series.Y.DataField = "开工至今累计_实际成本_机械费占比"'Y轴绑定到数量列
Series.DataLabelText = "{#YVAL:0.0%}"
Chart.AxisX.AnnoRotation = 30'X轴标示逆时针旋转45度
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South '图列显示在南方(底端)
Series.DataLabelText = "{#YVAL:0.0%}"
此主题相关图片如下:数据标示问题(1).jpg