+ Reply to Thread
Results 1 to 3 of 3

Is it possible to chart a point value with a thrid vector value (ie a rotating arrow?)

  1. #1
    Forum Contributor
    Join Date
    10-05-2005
    Posts
    112

    Is it possible to chart a point value with a thrid vector value (ie a rotating arrow?)

    Hi,

    I wondering if its possible to add a thrid dimension to an XY chart in the form of an arrow symbol which rotates is response to the associated table value? EG If i have the date on the X axis, wind speed on the Y axis.... it would be nice to show the wind direction via an arrow pointing in the correct direction like below?

    I'm suspecting it might be but with some complicated VBA !?

    vector.jpg

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

    Re: Is it possible to chart a point value with a thrid vector value (ie a rotating arrow?)

    Do you prefer VBA as a programming language? I don't think VBA would be "required" for this task, it would just be one possible programming language to choose. I generally prefer the basic spreadsheet formula language and not resort to an external (to Excel) programming language, but that is my personal preference.

    What chart type are you using? I find that adding vectors is much easier on a scatter chart. I cannot tell from your picture what you have, but it shouldn't be a problem as long as you are comfortable converting to a scatter chart. If not, then we may need to do some more work in the sheet to prepare the extra data series.

    Obviously, Excel does not have a built in "draw a vector on a chart" utility, but, as long as we are already comfortable with the math/trig of working with vectors, it is relatively easy to program in for one point/vector. The basic idea is to choose/calculate two points in the spreadsheet to represent the vector, then add those two points as a new series, formatted as line without marker and format the line to look like an arrow:

    1) Choose a starting point. In your picture, it seems pretty arbitrary (somewhere near the middle of the chart). Enter the x and y coordinates for this point.
    2) Somewhere, you have a bearing for the wind speed. I don't know if you intend to make the length of the vector arrow be related to wind speed or an arbitrary length, but you need a length for the vector. Once you have both length and bearing (polar coordinates, if you remember your trig) for the vector, convert those to rectangular coordinates and add to the starting point from step 1. Some thoughts in this post that may help when working with compass bearings rather than standard angles: https://www.excelforum.com/tips-and-...ml#post4309792
    3) Make sure the results of 1 and 2 are reasonably arranged in the sheet so they are easily added as a new data series to the chart (again, this is where using a scatter chart makes this really easy), then add the new data series to the chart (I usually recommend using the Select Data dialog for this -- especially if you are new to Excel and unfamiliar with other ways of adding data to a chart).
    4) Format the new data series to have the desired arrow appearance.
    5) Evaluate and adjust as necessary.

    Will that work for you, or is there something I have misunderstood?
    Last edited by MrShorty; 05-19-2022 at 11:48 AM.
    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
    10-05-2005
    Posts
    112

    Re: Is it possible to chart a point value with a thrid vector value (ie a rotating arrow?)

    Hi MrShorty,

    Thanks for getting back to me, much appreciated. I agree that if it can be done without the need for external code then all the better :-)

    What you descirbe is what I am trying to achieve, using a scatter graph should be fine so I will go away and see what I can do - my dataset looks like the below.

    I will report back with progress.

    Please Login or Register  to view this content.

+ 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. Maths behind rotating rectangle around start point instead of default center point
    By Stanley91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2014, 11:01 AM
  2. [SOLVED] 2D vector chart
    By Lollek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2013, 02:40 AM
  3. [SOLVED] 2D vector chart
    By Lollek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2013, 05:41 PM
  4. 2D Vector Chart
    By AndrewSL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2013, 03:07 PM
  5. Drawing an arrow/vector
    By macrowriter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2012, 03:34 AM
  6. How do I make an arrow appear to point out error?
    By kwengerd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2012, 04:01 PM
  7. Replies: 2
    Last Post: 06-27-2011, 10:47 PM

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