请教老师,用双图表的标示,柱形图前面都能显示标示,最后一个柱形不显示标示数字,如果只设置一个Series1.DataLabelText = "{#YVAL}"可以显示标示
设置两个,其中一个就有不显示或显示不全的问题
分别调换Series1.DataLabelText = "{#YVAL}"位置都不行
Dim Chart1 As WinForm.Chart '定义一个图表变量
Dim Series1 As WinForm.ChartSeries '定义一个图系变量
Chart1 = e.Form.Controls("Chart12") ' 引用窗口中的图表
Chart1.ChartType2 = ChartTypeEnum.Bar '图表1类型该为Bar(条形)
Chart1.ChartType = ChartTypeEnum.XYPlot '图表2类型该为线形
Chart1.DataSource = "总体分析_Table15" '设置绑定表
Chart1.SeriesList.Clear() '清除图表原来的图系
Series1 = Chart1.SeriesList.Add() '给图表1增加一个图系 折线图
Series1.Text = "项目数量"
Series1.X.DataField = "任务人员" 'X轴绑定到产品列
Series1.Y.DataField = "参与项目数量" 'Y轴绑定到数量列
Series1.LineThickNess = 3
Series1.MarkSize = 5
Series1.MarkShape = MarkShapeEnum.Dot
Series1.MarkColor = Color.Red
Chart1.SeriesList(0).LineColor= Color.Yellow
Series1.DataLabelBackColor = Color.Blue '蓝底
Series1.DataLabelForeColor = Color.White '白字
Chart1.SeriesList2.Clear() '清除图表原来的图系
Series1.DataLabelText = "{#YVAL}"
Series1 = Chart1.SeriesList2.Add() '给图表2增加一个图系 柱型图
Series1.Text = "员工提成"
Series1.X.DataField = "任务人员" 'X轴绑定到产品列
Series1.Y.DataField = "员工提成" 'Y轴绑定到数量列
Series1.DataLabelText = "{#YVAL}"
Chart1.AxisY2.Text = "员工提成(元)"
Chart1.AxisY.Text = "参与项目数量(个)"
Chart1.AxisX.AnnoRotation = 30 'X轴标示逆时针旋转45度
Chart1.AxisX.AnnoWithLabels = True '启用字符标示
Chart1.LegendVisible = True '显示图列
Chart1.LegendCompass= CompassEnum.South '图列显示在南方(底端)
[此贴子已经被作者于2017/6/27 10:52:45编辑过]