\'绘图
Dim Chart As WinForm.Chart \'定义一个图表变量
Dim Series As WinForm.ChartSeries \'定义一个图系变量
Dim t As Table = Tables("月FTY") \'定义一个变量t引用数据表
Chart = e.Form.Controls("Chart1") \' 引用窗口中的图表
Chart.VisualEffect = False
Chart.AxisX.DateType = True \'明确指定X轴是日期型
Chart.AxisX.AnnoFormatString = "MM-dd" \'指定日期标示格式
Chart.AxisY.Min = 0.98 \'指定Y轴的最小值
Chart.AxisY.Max = 1 \'指定Y轴的最大值
Chart.AxisY.Major = 0.002 \'主刻度间隔值为
Chart.SeriesList.Clear() \'清除图表原来的图系
For r As Integer = 0 To t.Rows.count - 1
Series = Chart.SeriesList.Add() \'增加一个图系
Series.Text = t.rows(r)("项目名称") \'设置图系的标题
Series.Length = t.Cols.Count - 1 \'设置图系的长度
For c As Integer = 1 To t.Cols.count -1
Series.X(c - 1) = c - 1
Dim str = "" & t.Rows(r)(c) & ""
str = System.Text.RegularExpressions.Regex.Replace(str, "[^0-9.]", "")
Dim yv As Double = val(str) / 100
Series.Y(c - 1) = yv
Chart.AxisX.SetValueLabel(c - 1, t.Cols(c).caption) \'指定字符表示
Next
Dim c1Chart1 = Chart.basecontrol
Dim lbls = c1Chart1.ChartLabels
For i As Integer = 1 To t.Cols.count -1
Dim lbl As C1.Win.C1Chart.Label = lbls.LabelsCollection.AddNewLabel()
lbl.Text = Format(series.y(i-1), "0.00%")
lbl.AttachMethod = C1.Win.C1Chart.AttachMethodEnum.DataIndex
lbl.AttachMethodData.GroupIndex = 0
lbl.AttachMethodData.SeriesIndex = 0
lbl.AttachMethodData.PointIndex = i-1
lbl.Style.ForeColor = Color.Red
lbl.style.font = new font("宋体", 8)
lbl.Compass = LabelCompassEnum.South
lbl.Visible = True
Next
Next
为什么只在第一条线有显示呢??

此主题相关图片如下:23.png
