+ Reply to Thread
Results 1 to 15 of 15

Scatter chart with colors and shapes based off of values

  1. #1
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Scatter chart with colors and shapes based off of values

    Hi,

    I have two tabs; Ratings & Visual. The ratings tab is the data that populates the scatter chart. Y axis is from the set-1 questions while the X axis is from the set-2 questions. Set-3 I am trying to use as a color code mechanism and set-4 as the shape.

    I am trying to figure out how to change the color of the data marker as well as the shape based off of values. I've added an example on the bottom of the "ratings" tab of what I am trying to use a values. Is this Possible? I've seen some examples via VBA but that is beyond my skillset. Any help is greatly appreciated.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    I would probably combine the conditional formatting technique I demonstrate here https://www.excelforum.com/tips-and-...p-example.html with the conditional formatting based on color like Jon Peltier describes here: https://peltiertech.com/conditional-...-excel-charts/

    Overview:
    1) You have three different colors, so you will need three data series (three rows in the spreadsheet) -- One for each color. Follow Peltier's tutorial to set this up and add the three data series to your chart. At some point, format each data series to have no line and no marker.
    2) For the "smiley" text symbols, add a fourth row for data label text, populate this row with the desired smiley face based on the conditions. Then use this row for the data labels (centered). If you are still using 2010 as indicated in your profile, it is much easier to use a third party addin like Rob Bovey's that I talk about in my tutorial. If you have upgraded to 2013 or newer, you should find this functionality native to Excel (somewhere in the data label text options). Format the data labels to use the Wingdings font and the desired font color.

    That should give you the desired text "shape" for each point with the desired color.

    Bonus suggestion. Rather than using drawing shapes for the background colors in the chart, I would probably use a technique like this: https://peltiertech.com/shaded-quadr...scatter-chart/
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Thanks, I was able to get 3 color codes setup. Similar to what you posted but I used this link; "Non-vba solution" halfway down.
    https://stackoverflow.com/questions/...o-column-value


    Back to the marker symbols. Is there a way to reference conditional formatting icons or the built-in marker icons? It would be nice to have another set of values referenced that would change the icon type. In my example, it would be the set-4 data.

    Conditional formatting icons: Home/Conditional Formatting/Icon Sets
    Marker Icons: Chart Tools/Format/Format Selection/Fill/Marker Options/Built-in/Type

    I tried the example you gave but struggling a little with the example.

    Thank you for all of the help!

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    You don't say what difficulty you are having, so I'm not sure what to recommend. To be clear, my tutorial basically replaces the built in symbol with a data label containing the desired text character you want to use. In the OP, you showed different smiley faces (characters J, K, L using the Wingdings font). This technique can work for any character you can find a character + font combination for. In my example, I used the UNICODE characters 10102-10110 (numbers enclosed in dark circles characters) and a font that supports those Unicode characters. Most of those other shapes are available in different character + font combinations. It will have trouble if you choose symbols from different fonts, but, as long as you choose symbols from the same font, this technique should work.

    You mention the possibility of using the build in chart marker icons. (I did not suggest this previously because you used smiley faces which are not a build in chart marker icon) If this is the route you want to go, then you just need to extend the technique you are already using. I expect you have three data series based on color. To get symbol+color combination, extend that so that you have a different row/data series for each marker + color combination.
    row/dataseries 1 -- red square -- formula to test conditions and return value if it fits the criteria for red square or NA() if not.
    row/dataseries 2 -- yellow square -- formula to test conditions and return value if it fits the criteria for yellow square or NA() if not.
    row/dataseries 3 -- green square -- formula to test conditions and return value if it fits the criteria for green square or NA() if not.
    and so on through 3x3=9 color+symbol combinations. Add each row/dataseries as a separate data series to the chart and format accordingly.

    If you help me understand what you are having trouble with using data labels, I can help you with that approach. Or, if you just want to use the built in chart symbols (like square, circle, triangle, etc.), then extending the technique you are currently using may be easier.

  5. #5
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Thank you. I do apologize for not being specific in my issues. Let me clean up the example spreadsheet and get that attached here shortly.

    With how you mentioned the icons it would be Red, yellow, Green AND circle, square. So each color could also be each one of those shapes.
    Set3 value determines the color while set4 value determines the shape. The color and shape do not relate.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    So each color could also be each one of those shapes.
    If I understand the question here, yes. Each color + symbol combination is its own dataseries, and you can have as many dataseries as you want (up to Excel's built in limits -- which are probably way beyond anything that you are likely to encounter).

  7. #7
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    I think I figured this out (see attachment) and started with 3colors and 2shapes. Basically broke the dataseries down like this;

    green/circle
    green/square
    yellow/circle
    yellow/square
    red/circle
    red/square

    This works for me unless you see a more efficient way of this doing this.
    Next week, I plan on trying out the bonus suggestion you had. Looks interesting.

    Thank you again for the help!

    And I updated my profile, I'm on 2013 now. Thanks
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    That looks good. I don't think I would change anything.

  9. #9
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Quote Originally Posted by MrShorty View Post
    That looks good. I don't think I would change anything.
    I'm trying the bonus round and not sure what I am doing wrong. My goal is a 4x4 with a 1-5 XY axis maximum. Why is the Y axis extending to 11? Thank you
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    I would guess that it is a misunderstanding of how "stacked" charts work. Looking just at the leftmost group of stacked areas:

    1) The first (invisible) one extends from the top down to 1.
    2) The second (grey) one extends from 1 up 1.5 units to 2.5.
    3) The third (dark blue) one extends from the top of the previous (2.5) up 2 units to 4.5
    4) The fourth (light blue) one extends from the top of the previous (4.5) up 2.5 units to 7
    5) The top (light grey) one extends from the top of the previous (7) up 4 units to 11.

    If that is not what you want, then you need to adjust the values in the spreadsheet so that they stack appropriately. If you want the bottom grey stack to end at 1.5, the value in E10:E11 needs to be 0.5.

  11. #11
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Quote Originally Posted by MrShorty View Post
    I would guess that it is a misunderstanding of how "stacked" charts work. Looking just at the leftmost group of stacked areas:

    1) The first (invisible) one extends from the top down to 1.
    2) The second (grey) one extends from 1 up 1.5 units to 2.5.
    3) The third (dark blue) one extends from the top of the previous (2.5) up 2 units to 4.5
    4) The fourth (light blue) one extends from the top of the previous (4.5) up 2.5 units to 7
    5) The top (light grey) one extends from the top of the previous (7) up 4 units to 11.

    If that is not what you want, then you need to adjust the values in the spreadsheet so that they stack appropriately. If you want the bottom grey stack to end at 1.5, the value in E10:E11 needs to be 0.5.

    Ok, I think I have it. Rather than starting at zero, is there a way to start at one for both X&Y without setting minimum/maximum bounds from the ctrl+1 screen?

    Thanks again! this is awesome.
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    Yes, you can use VBA to bypass many of Excel's dialogs, including the properties in the format axis dialogs. Whether it is worth the effort depends on why you are trying to bypass the dialog (usually because you will need to frequently change the axis scale properties). In this case, if I understand, it seems like you would need to format the axes once and then never need to change them again, so it seems like more work than necessary.

    This tutorial discusses the idea: https://peltiertech.com/link-excel-c...lues-in-cells/ Note the link at the end to another tutorial that offers a different VBA approach.

  13. #13
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Quote Originally Posted by MrShorty View Post
    Yes, you can use VBA to bypass many of Excel's dialogs, including the properties in the format axis dialogs. Whether it is worth the effort depends on why you are trying to bypass the dialog (usually because you will need to frequently change the axis scale properties). In this case, if I understand, it seems like you would need to format the axes once and then never need to change them again, so it seems like more work than necessary.

    This tutorial discusses the idea: https://peltiertech.com/link-excel-c...lues-in-cells/ Note the link at the end to another tutorial that offers a different VBA approach.
    Is there a way to have a legend without showing the stacked-chart layers? I am trying to show a legend just for the actual xy data of the chart.

    Thank you

  14. #14
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Scatter chart with colors and shapes based off of values

    You can remove individual entries from the legend by:

    1) click on the legend to select the legend
    2) click on the legend entry you want to delete so that only that entry is selected.
    3) press the Del key.

  15. #15
    Registered User
    Join Date
    09-23-2012
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Scatter chart with colors and shapes based off of values

    Quote Originally Posted by MrShorty View Post
    You can remove individual entries from the legend by:

    1) click on the legend to select the legend
    2) click on the legend entry you want to delete so that only that entry is selected.
    3) press the Del key.
    Worked perfectly! Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Changing cells and column chart colors based on cell colors
    By HDeuce in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2016, 11:43 AM
  2. Changing colors of shapes based on a click (VBA)
    By domexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2014, 10:52 AM
  3. XY Scatter Chart: unique point colors and shapes
    By escobf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2013, 10:45 AM
  4. Scatter Chart - one Series - different colors possible?
    By meiomei in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-03-2013, 11:44 AM
  5. Excel column chart colors based on values of a different series
    By brokerbevo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2013, 01:17 PM
  6. Replies: 1
    Last Post: 03-26-2012, 02:52 PM
  7. X-Y Scatter Chart with min, med and max x-values
    By agilder in forum Excel General
    Replies: 8
    Last Post: 06-20-2011, 07:37 AM

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