Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change color of data series points in xy scatter plot

Status
Not open for further replies.

Jayzxtx

Technical User
Oct 2, 2007
6
US
am trying to use a toggle button in excel to change the color of certain points on a xy scatter plot based on the xy values from a data sereies. I wrote a macro that changes a specific point on the gragh,but i am trying to understand how to change the color based on the xy values of the data series as opposed to a point (example point 69) in the code.

Thanks for the help in advance
vb Code:

Private Sub ToggleButton10_Click()
If ToggleButton10.Value Then

Columns("CXI").Select
Selection.EntireColumn.Hidden = True

Else

Columns("CXI").Select

Selection.EntireColumn.Hidden = False

Sheets("Benzene").Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(69).Select
With Selection.Border
.ColorIndex = 43
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = 43
.MarkerForegroundColorIndex = 43
.MarkerStyle = xlDiamond
.MarkerSize = 5
.Shadow = False
End With

End If
End Sub
 



Hi,

In your SHEET, where your source data is, use a forumla(s) to display the values in different columns/rows, based on the value. Make a SERIES for each of these additional columns/rows, of a different color.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Skip I am trying to make the scatter plot graph dynamic. For example I have 5 sets of columns each set containing 12 colums to denote 12 months wihtin a year. Each column set has a toggle button. When I push a toggle button It will hide one of the 5 column sets from the source data and the xy scatter plot. I can select two columns to hide multiple column sets or years. The problem is on my xy scatter plot I can't set a color based on what is being toggled on or off.

Can you give me a example of a formula?

Thanks for the help
 
My Criteria:
<0 RED
>=0 GREEN
[tt]
Existing New New
column A RED Column GREEN Column
=if(A2<0,A1,"") =if(A2>=0,A1,"")
5 5
-5 -5
[/tt]
My Column A Series (all the same color markers). Delete this series an add two new series: one RED and other GREEN.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top