datavisualization charting 4.0
I'd like to build in an option for the end user to be able to select line colors of their choice. Is there something out there regarding that?
I did find this Manipulating the Chart Appearance
Visual Basic 2010 doesn't like this code. I looked in references for dlgChart in case that was the issue. Didn't find it or anything like it. I suspect the problem is my chart is a datavisualization chart and this references MSChart. I did fiddle with the code a bit but no luck.
I'd like to build in an option for the end user to be able to select line colors of their choice. Is there something out there regarding that?
I did find this Manipulating the Chart Appearance
Visual Basic 2010 doesn't like this code. I looked in references for dlgChart in case that was the issue. Didn't find it or anything like it. I suspect the problem is my chart is a datavisualization chart and this references MSChart. I did fiddle with the code a bit but no luck.
VB.NET:
Private Sub MSChart1_SeriesActivated(ByVal Series As _
Integer, ByVal MouseFlags As Integer, ByVal Cancel As Integer)
' The CommonDialog control is named dlgChart.
Dim red, green, blue As Integer
With dlgChart ' CommonDialog object
.ShowColor()
red = RedFromRGB(.Color)
green = GreenFromRGB(.Color)
blue = BlueFromRGB(.Color)
End With
' NOTE: Only the 2D and 3D line charts use the
' Pen object. All other types use the Brush.
If MSChart1.chartType <> VtChChartType2dLine Or _
MSChart1.chartType <> VtChChartType3dLine Then
MSChart1.Plot.SeriesCollection(Series). _
DataPoints(-1).Brush.FillColor. _
Set(red, green, blue)
Else
MSChart1.Plot.SeriesCollection(Series).Pen. _
VtColor.Set(red, green, blue)
End If
End Sub