如附件所示,
1.怎么让数据标注中的X=7替代成X=7下面所对应的数据?.
2.怎么改变拆线处圆点和三角形的大小?
3.日期Series.X.DataField = "月份" 是这样写的,但在生成图表时怎么提示日期数据有错?
相关代码
Dim Chart As WinForm.Chart '定义一个图表变量
Dim Series As WinForm.ChartSeries '定义一个图系变量
Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
Chart.VisualEffect = True
Chart.ChartType = ChartTypeEnum.xyplot
Chart.ChartType2 = ChartTypeEnum.XYPlot
Chart.DataSource = "产品销售表" '设置绑定表
Chart.SeriesList.Clear() '清除图表原来的图系
Series = Chart.SeriesList.Add() '给图表1增加一个图系
Series = Chart.SeriesList.Add() '增加一个图系
Series.TooltipText = "X = {#XVAL}, 件数 = {#YVAL}"
Series.Text = "件数"
Series.X.DataField = "月份"
Series.Y.DataField = "件数"
Chart.SeriesList2.Clear() '清除图表原来的图系
Series = Chart.SeriesList2.Add() '给图表2增加一个图系
Series.Text = "金额(元)"
Series.X.DataField = "月份"
Series.Y.DataField = "金额"
Chart.LegendVisible = True '显示图列
Chart.LegendCompass= CompassEnum.South
Chart.AxisX.Text = "档次"
Chart.AxisY.Text = "月份"
Chart.AxisY2.Text = "金额"
Chart.BarClusterWidth = 50
Chart.BarClusterWidth2 = 50
Chart.AxisX.AnnoRotation = - 45
Chart.PrintWidth = 180
Chart.PrintHeight = 150
Series.TooltipText = "X = {#XVAL}, 金额 = {#YVAL} "
此主题相关图片如下:图表.jpg
X轴DataField日期型数据报错如图
此主题相关图片如下:2.jpg