Click to See Complete Forum and Search --> : Series color and right mouse clicks


Andrew
October 20th, 1999, 03:50 PM
Hi – I have the following code in MSChart´s SeriesActivated routine which shows the common controls Color box and allows users to select a different color for the select chart series.


private Sub MSChart1_SeriesActivated(Series as Integer, MouseFlags as Integer, Cancel as Integer)
Dim red, green, blue as Integer

With dlgChart
.ShowColor
red = RedFromRGB(.Color)
green = GreenFromRGB(.Color)
blue = BlueFromRGB(.Color)
End With

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 If

End Sub




I also have the following code in the chart´s MouseDown routine that shows a popup menu that has, amongst other options, a ´Colors’ option.


private Sub MSChart1_MouseDown(button as Integer, _
Shift as Integer, x as Single, Y as Single)

If button = vbRightButton then
PopupMenu mnuPopUpGráficas
End If

End Sub




Ideally I would like to have the user be able to change the color of the chart series by right clicking on a particular series, selecting ‘Color’ and then picking the color option from the common dialog window. Unfortunately the first routine only shows the colors window when the user double-clicks the series, and I can´t seem to get the two routines to communicate as to which particular series has been selected. I want to have all options (graph rotation, series color, title font, etc) organized into one popup menu so that the user won´t have to worry about when to right click, left click, double click, etc.

Any suggestions? Should I be using a different routine?

Thanks,

Andrew