+ Reply to Thread
Results 1 to 4 of 4

how to add a text box to a chart position it ?

  1. #1
    Registered User
    Join Date
    12-22-2008
    Location
    Sweden
    Posts
    56

    how to add a text box to a chart position it ?

    Hi,
    How can I with a macro create text boxes and place them in a chart?
    TO each textbox there should be an arrow that points towards a certain Y value on the y-axis. I've tried versions of the code below, But I don't know how to link the y-axis vaule with the position of the arrow and text box.
    Any suggestions?


    Please Login or Register  to view this content.
    Last edited by 77anders; 03-17-2009 at 11:40 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: how to add a text box to a chart position it ?

    Can you post example chart and describe what you are trying to do.

    Can you not use data labels to display text?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-22-2008
    Location
    Sweden
    Posts
    56

    Re: how to add a text box to a chart position it ?

    I would like to create something like this (See attached file). The lines in the schart will chage after a macro is finished. THe text boxes has to be created and filled in with values from variables in the overall macro (min max values etc).
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: how to add a text box to a chart position it ?

    This uses an additional xy series to display data labels.
    The data label text is linked to cells which contain all the information to be displayed.

    If you need leader lines you can add another series to create those.


    If you still need to add and position the textboxes via code then this may help.
    http://www.andypope.info/vba/Axislabel_textboxes.htm

    You need to workout the plotareas dimensions in relation to the axis scale and then calculate the new position of the textbox given a X and or Y value at which to place it.
    Attached Files Attached Files

+ Reply to Thread

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