+ Reply to Thread
Results 1 to 20 of 20

Coordinate graph

  1. #1
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Coordinate graph

    Good morning everyone.

    I am trying to build a Coordinate graph where I input my (date, item, x value, y value) in my table and excel will plot it on my coordinate chart. I don't know if a code has to be done or a formula, could someone help? Or if someone knows where I could find a spreadsheet that would do basically do what I am trying to do. This is nothing special just trying to plot them weekly and see a pattern.

    Please feel free to change or add something I may have not added or overlooked.

    Thank you for your time,
    Brian
    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,829

    Re: Coordinate graph

    I am not sure what you are trying to do in your spreadsheet. If you want to plot data on an XY scatter chart, is there a reason you are not trying to use Excel's built in XY scatter chart? https://support.office.com/en-us/art...5-104a9018b86e
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Thank you Mr. Shorty, you have always been a big help with your information of us. I have already tried this and it really doesn't fit what I am trying to do. Also the charts that excel uses leave much to be desired and do have limitations.

    1.)What I am trying to do is plot on both axis's (x,y) (+,- values) the (items) to see a pattern, whether a (dot or dash mark) is used I don't care on the graph as long as it is visible.

    2.)These coordinates have to be static once they are plotted on the graph for a time as the graph values are static and will not change as I review and look for patterns presenting themselves as I keep updating the research for about 1 months time. Then once a pattern is discovered the graph is cleared and started again with new data.

    3.)It would also be nice to have the "date" tagged to the "Item" plotted on the graph as we will be able to review it and have some kind of reference to what that point is and where it is being seen in relation to other items being plotted. Also we are looking at maybe having the item be colored a special color if both (axis's values are NEGITIVE) EXAMPLE x=-1, y=-5)

    This is a scientific graph system, each sector within a quadrant is = to 12ft squared THUS we will be able to mathematically figure out the rate of distance traveled and also what speed within a giving time frame all based on this chart.

    So we are looking at formulas or Macros that will plot our data so calculations can begin.
    Scatter plots are good for money and financial data, this is more precise and scientific.

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

    Re: Coordinate graph

    As a scientist, mathematician, and engineer, I think I understand fairly well what scatter plots do well and where they fall short. I don't yet understand why one of Excel's built in scatter plots won't work:

    1) This should be the default behavior for a scatter plot. Choice of dot or dash or square or triangle or whatever are fairly easily controlled using the format series dialog.
    2) As long as data does not change in the spreadsheet, they should not change in the chart. If you assign the X and Y values ranges appropriately, it should be easy to add as much data as you want to the chart (up to Excel's limitation which are quite large for 2010). When you are ready to clear the chart, simply clear the data range and start filling with new data.
    3) The easiest way to "tag" a data point with a value/text from a range is to use Rob Bovey's XY chart labeler add-in, or to use 2013 or later, which has this functionality built into Excel.
    Also we are looking at maybe having the item be colored a special color if both (axis's values are NEGITIVE) EXAMPLE x=-1, y=-5)
    The easiest way I have found to "conditionally format" data points in a chart is to plot each "color" you want as a separate series http://peltiertech.com/conditional-f...-excel-charts/

    I personally tend not to use the chart to calculate distances or rates, preferring instead to calculate those kinds of quantities in the spreadsheet. I can use a chart to visualize things and help see how to calculate any derived quantities I want to calculate, but I don't find the charts themselves very useful for computing quantities. Perhaps this is why you don't want to use the built in scatter plots, though I don't see how the spreadsheet you have is going to help with these (possibly because I do not yet understand everything about the project you are undertaking.

    I don't have immediate access to Excel right now, but, perhaps if you walk through the analysis once, I can better understand what you are doing and can make better suggestions.

  5. #5
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    We would prefer to do it this way Mr. Shorty. Thank you for you time.

  6. #6
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    http://peltiertech.com/conditional-f...-excel-charts/
    Yes we are thinking along those lines and are working with this idea.

  7. #7
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    This graph is a direct representation of the aerial view of a area we are researching and we will plot our findings on this chart and then compare it to the aerial views we have. We have tried all day with the scatter plots excel give you and they will not work, as once we delete the x and y data these chart reset the size they are and this can not happen. So we have to do it this way with the graph I uploaded. So formulas or Macros is the only way we can go.

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

    Re: Coordinate graph

    We have tried all day with the scatter plots excel give you and they will not work, as once we delete the x and y data these chart reset the size they are and this can not happen.
    I cannot recreate this behavior. It might help to upload a sample file with what you are trying.

    FWIW, here is a sample I made up (now that I am on a computer with Excel). I tried very quickly to match the scatter plot's size to the lines you drew on your spreadsheet, then fixed the axis limits to +/-50, crossing at 0. I can clear the data range, and the chart stays the same (except that the data points disappear). I can add varying numbers of data points within the data range, I could expand the data range to account for more data points. I could add the dates as data labels (if I had Rob Bovey's add-in on this computer). I think that, if I am going to understand what you need to do, I would need to understand what this chart does that you don't want it to do, or does not do that you need it to do.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    How do you get the chart to stay that size?

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

    Re: Coordinate graph

    Are you referring to the chart area or the plot area? I did not do anything to make either stay a certain size. For me, when I size the chart area and plot areas, they tend to stay that size. The only exception I find is using the insert/delete row/column commands. When executed on a row/column that goes through a chart, the chart will expand/contract with the inserted/deleted rows. In those cases, I simply have learned not to use the insert/delete row/column commands. Could that be part of your scenario -- using insert/delete row/column. (If there is any confusion at all, be sure to note that I am making an important distinction between the delete and clear commands).

    If you are talking about the axes, I simply formatted each axis with the desired minimum and maximum values in the format axis dialog.

  11. #11
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    That is the problem...using the insert/delete row/column commands...When executed on a row/column that goes through a chart, the chart will expand/contract with the inserted/deleted rows. How do we stop this?

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

    Re: Coordinate graph

    I am not aware of any way to stop it. As I noted, my solution for me is to be thoughtful about using the insert/delete row/column commands. If I don't want these kinds of effects to take place, I will look for a different combination of copy/cut/paste/etc. that will do the same thing as the insert/delete command. Or maybe I will be more careful about where I place the chart on the spreadsheet so that the chart will not overlap any rows/columns I will want to delete/insert between (Sometimes maybe even putting the chart on its own sheet and maybe creating a second window so I can see both the data and chart at the same time). Along those lines, one would need to know in some detail exactly how you are using the spreadsheet (editing adding and removing data while searching for patterns in the chart and so on) in order to make specific suggestions.

    I could also see the possibility of some kind of event code that would detect these kinds of changes to the chart and correct them. Since this isn't the kind of programming I do, I am not sure what event would be appropriate. If you want to pursue this approach, someone else may need to step in who is more familiar with event code.

  13. #13
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Thank you so much for your time and help in this matter. You have always been a big help for us and are greatly appreciated!!
    Yes so code would be nice to stop this resize, as we hate this and while we see you can add labels but only x, y and not a actual name. We found this code to add labels on Microsoft website...
    https://support.microsoft.com/en-us/kb/213750

    but it isn't working for us as we are using xls 2010

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

    Re: Coordinate graph

    I use Rob Bovey's XY chart labeler add-in (appspro.com ), but I don't see why MS's code should not work. Can you explain what "does not work" means? Is it giving a compile error? A run-time error? It runs but does the wrong thing?.

    I will see if someone else can come on board to talk about the auto-resize issue. I suspect that they will want to know in some detail how you are sizing the chart, and what are the critical elements of the chart size.

  15. #15
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Yes MrShorty, here is the error we are getting when running the macro

    Object variable or With block not set.

  16. #16
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Yes MrShorty, here is the error we are getting when running the macro

    Object variable or With block not set.

    I have attached the workbook with the macro
    Attached Files Attached Files

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

    Re: Coordinate graph

    When I open and run the code (using F8 to step through line by line), I get the same error on the xVals = ActiveChart.SeriesCollection(1).Formula statement. Check what is active and I find that a cell in the sheet is active and not the chart. After selecting/activating the chart, it works just fine. You either need to make sure you activate the chart before the code runs, or adjust this (and any other "activechart" statements) to refer to the desired chart object on the sheet.

  18. #18
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Got it! I have to slow down,LOL. Now if I can get this resizing fixed I'd be good to go.

  19. #19
    Forum Contributor
    Join Date
    06-23-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    239

    Re: Coordinate graph

    Case solved MrShorty...THANK YOU!!!!

  20. #20
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Coordinate graph

    All you need do to fix the size is to right-click the chart, choose Format Chart Area and in the Properties section check the 'Do not move or size with cells' option. With VBA this would be thus
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. Angle from coordinate
    By sanju2323 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-05-2016, 10:12 AM
  2. xy coordinate sorting
    By joschij in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2014, 12:45 PM
  3. VBA: Copy equation from graph to cell; update all if numbers in Y-coordinate changes
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-09-2012, 01:22 AM
  4. coordinate conversion
    By stewman in forum Excel General
    Replies: 1
    Last Post: 02-24-2011, 10:45 AM
  5. Coordinate Conversion
    By stewman in forum Excel General
    Replies: 3
    Last Post: 12-16-2010, 06:51 PM
  6. Coordinate Conversion Help
    By stewman in forum Excel General
    Replies: 4
    Last Post: 12-06-2010, 01:57 PM
  7. return value of X coordinate and Y coordinate?
    By sbmoller in forum Excel General
    Replies: 1
    Last Post: 09-22-2007, 06:54 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