
MsChart & Returning Original Color
I have the following code I pulled off the MS knowledge base on how to
convert colors on a bar chart to patterns of black and white.
My application sends a chart with colors, and has a command button to
change to black and white. However, I need to revert back to the original
colors, as my client has asked to be able to toggle (Via the cmdbutton)
between patterns and the colors as determined by the default series colors.
My routine was written as a do loop but uses the same theory.
How do I reset the colors to the original values, as the 255,255,255 of the
fillcolor.set has made them black? Is there a way to save the original
values, or is there an easier way that I am missing.
Private Sub Command1_Click()
MSChart1.Plot.SeriesCollection(1).DataPoints(-1).Brush.Style _
= VtBrushStylePattern
MSChart1.Plot.SeriesCollection(1).DataPoints(-1).Brush.Index _
= VtBrushPatternBoldDownDiagonal
MSChart1.Plot.SeriesCollection(1).DataPoints(-1).Brush.FillColor.Set _
255, 255, 255
MSChart1.Plot.SeriesCollection(2).DataPoints(-1).Brush.Style _
= VtBrushStylePattern
MSChart1.Plot.SeriesCollection(2).DataPoints(-1).Brush.Index _
= VtBrushPatternBoldHorizontal
MSChart1.Plot.SeriesCollection(2).DataPoints(-1).Brush.FillColor.Set _
255, 255, 255
End Sub
TIA