+ Reply to Thread
Results 1 to 4 of 4

Help with XY charts

  1. #1
    Registered User
    Join Date
    02-12-2018
    Location
    canada
    MS-Off Ver
    2016
    Posts
    2

    Help with XY charts

    I want to plot a bunch a of data in VBA. my X axis is in "YYYY/MM/DD h:mm" format. when I plot it using XLline, it plots all the data from different times of one day under one X tang based on one day. for example it shows two vertical lines for dozens of data for two different days.
    when I change the graph type to XLxyscatter, the problem is solved but I have no control on editing the chart as I need to control the minimum-maximum of Y axis and major units on X axis.

    here is my code:
    Please Login or Register  to view this content.
    Basically when I choose XLxyscatter the part between starts is not run. Can someone help me please?
    Attached you can see the Xlline and XYscatter results from the code.
    scatter.jpg
    line.jpg
    Last edited by shdgv; 02-12-2018 at 06:03 PM.

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

    Re: Help with XY charts

    This forum can be strict about rules -- like putting code in code tags. Please edit your post to include them, lest someone come along and prevent further replies to your topic.

    I see no reason why you should not be able to adjust the axis limits of either axis, nor why the code in between the stars should not run. Can you upload a small sample file so we can see this in context?
    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
    02-12-2018
    Location
    canada
    MS-Off Ver
    2016
    Posts
    2

    Re: Help with XY charts

    Thank you for the reply. It was my first time posting and did not know about the code tag rule.

    The results of the code is frustrating to me. I do not get any errors for those lines but as you can see in the photos, the codes make no change on the axes.
    any suggestions?

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

    Re: Help with XY charts

    I am unable to debug for you. The only thing I noted is that startdate and finishdate are not assigned values, so the initial run through errored on those lines that set the range. Once I assigned suitable values to those variables (I used 2 and 20, since those are the rows I used for the dummy data I tested on), the code seemed to run just fine. I guess I can suggest that you check the values for startdate and finishdate (using locals window or other debug tool: http://www.cpearson.com/excel/DebuggingVBA.aspx ) and make sure they are reasonable. Other than that, I see nothing wrong with the code you posted.

+ 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. Replies: 32
    Last Post: 07-17-2018, 03:08 AM
  2. VBA charts update - dynamically test sheet type for two types of charts
    By kapucino in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2017, 07:00 AM
  3. [SOLVED] Vary Colors in Pivot Charts based on values (Overlay Charts)
    By TitansGo in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-18-2017, 04:36 PM
  4. Replies: 0
    Last Post: 10-12-2015, 03:25 AM
  5. Replies: 2
    Last Post: 09-15-2015, 04:12 AM
  6. copying multiple charts from excel to word overwriting previous charts
    By eric45 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 11:11 AM
  7. Creating simple charts from multiple pivot table charts
    By hovaucf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2008, 04:13 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