Dim i As Integer
Dim Chart As WinForm.Chart = e.Form.Controls("Chart1")
Dim C1Cha As C1.Win.C1Chart.C1Chart = Chart.BaseControl
Dim Series As WinForm.ChartSeries
Chart.VisualEffect = True
'Chart.ChartType = ChartTypeEnum.Bar
Chart.ChartType = ChartTypeEnum.XYPlot
chart1.Parent = pictureBoxBackground '
报错提示chart1被保护不能访问,如何处理?
chart1.Series.Clear()
Dim series As New Series("MySeries")
chart1.Series.Add(series)
series.ChartType = SeriesChartType.Line '
For i As Integer = 0 To 9
series.Points.AddXY(i, i + Rand.Next(5))
Next
chart.Parent = pictureBoxBackground
'Using System.Windows.Forms.DataVisualization.Charting
'Dim Chart As WinForm.Chart '定义一个图表变量
'Dim Series As WinForm.ChartSeries '定义一个图系变量
'Chart = e.Form.Controls("Chart1") ' 引用窗口中的图表
'' 设置图表的背景色为透明或与背景图匹配的颜色
'' Chart.BorderSkin.SkinStyle = BorderSkinStyle.None ' 移除图表边框
'' 移除图表的边框
'Chart.ChartAreas(0).AxisX.LineWidth = 0
'Chart.ChartAreas(0).AxisY.LineWidth = 0
'Chart.BorderWidth = 0
'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
'End Using
报错:Using System.Windows.Forms.DataVisualization.Charting中DataVisualization不是Forms的成员?
Dim b2 As C1.Win.C1Chart.C1Chart = e.Form.Controls("Chart2").BaseControl
b2.BackColor = Color.white 'Transparent
b2.ChartArea.Style.BackColor = Color.white 'Aqua '图板颜色
b2.ChartArea.Style.Border.BorderStyle = 0 '图板外形框线型
b2.ChartArea.Style.GradientStyle = 0 '图板外形框样式
b2.Style.Border.BorderStyle = C1.Win.C1Chart.BorderStyleEnum.None b2.ChartArea.Style.Border.BorderStyle = C1.Win.C1Chart.BorderStyleEnum.None |
参照这样写
[此贴子已经被作者于2024/3/12 11:36:12编辑过]