Results 1 to 3 of 3

conditional format data point in scatter plot

Threaded View

  1. #3
    Registered User
    Join Date
    07-27-2011
    Location
    Nottingham,England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: conditional format data point in scatter plot

    Sorry, obviously didn't read the rules properly original post shown here again with code tags

    I've been trying for some time to write some code to conditionally format data points in a scatter plot.

    The following is an extract which formats the data point style for a range of data series, not very tidy I know, but it works. I wanted to control the data point style and size of series 1-29, 29-58 etc. I know hard coding is never a good idea, but it was the best I could do.

    Data labels are switched off because there are too many and the chart was crowded, however I do want the data labels to show if the sum of x-co-ord muliplied by y co-ord is greater than a stated figure

    x vals are decimals between 1 and 5
    y vals are decimals between 1 and 5

    I want all data points where x times y >20 to have the data labels switched on.

    Any suggestions would be great

    Extract of existing code as follows, remainder just repeats for the for the next x series and applies a different data point style

    Thanks

    I've attached a copy of the spread sheet with all identifying information removed, what I want is to automatically attach data point labels to every data point in the top right hand corner, ie everything with a risk score >20

    Private Sub Chart_Activate()
    Application.ScreenUpdating = False
    
    Dim Answer As String
    Dim MyNote As String
    
    'Place your text here
    MyNote = "Do you want to update the chart?"
    
    'Display MessageBox
    Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Chart Update")
    
    If Answer = vbNo Then
    'Code for No button Press
    'MsgBox "You pressed NO!"
    Else
    'Code for Yes button Press
    'Regulatory
    
    Dim i As Integer
    total = 0
    
    For i = 1 To 29
    
    
    ActiveChart.SeriesCollection(i).Select
    Selection.MarkerStyle = 3
    Selection.MarkerSize = 6
    MarkerBackgroundColorIndex = 3
    
    ActiveChart.SeriesCollection(i).ApplyDataLabels
    ActiveChart.SeriesCollection(i).DataLabels.Select
    Selection.ShowSeriesName = False
    Selection.ShowValue = False
    
    
    Next i
    Last edited by adam1630; 08-03-2011 at 06:46 AM. Reason: forgot to attach file

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1