Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date values not appearing correclty in the x-axis

Hi,

I am trying to display a graph from an ABAP program into an excel sheet via the following macro. The data is in the format:

DATE - PRICE - VENDOR

08.10.2010 - 50 - 200000

08.10.2010 - 75 - 200000

08.10.2010 - 25 - 200000

08.10.2010 - 75 - 200000

14.10.2010 - 100 - 100117

10.02.2011 - 3 - 100926

Here i am trying to create a graph with different series for each vendor. Along x-axis are the date values and the Price is along the Y-Axis. While doing so everything is fine except that the x-axis does not show the date values in the correct format, rather it is displaying them in the form of numbers like 0.5, 1 , 1.5 , 2 and so on. Instead what i want is to display the date values along the x-axis in the dd-mm-yyyy format.
Code:
Code:
sub draw_graph()
charts.add
activechart.charttype = xllinemarkersStacked
activechart.location whe=xllocATIONASOBJECT, NAME:="sheet1"'.
WITH ACTIVECHART
..PARENT.HEIGHT = 325
..PARENT.WIDTH = 500
..PARENT.TOP = 75
..PARENT.LEFT = 200
..HASTITLE = TRUE
..CHARTTITLE.CHARACTERS.TEXT = " Commodity Price Graph "
..hasLegend = false
..Axes(xlCategory, xlPrimary).HasTitle = True
..axes(xlCategory, xlprimary).axisTITLE.CHARACTERS.TEXT = "Date"
..AXES(XLVALUE, XLPRIMARY).HASTITLE = TRUE
..AXES(XLVALUE, XLPRIMARY).AXISTITLE.CHARACTERS.TEXT = "Price(INR)"
..Axes(xlValue).MaximumScale = AppLICATION.WORKSHEETFUNCTION.MAX(RANGE("B:B"))
..AXES(XLVALUE).MINIMUMSCALE = APPLICATION.WORKSHEETFUNCTION.MIN(RANGE("B:B"))
..SeriesCollection(1).ApplyDataLabels AutoText:=True
End With
End sub
Any help will be deeply appreciated. Thanks in advance.

Skydrive link for the sample: http://cid-9aa00329a92b0b2c.office.l...ue/Sample.xlsx

Skydrive link for the original ABAP code : http://cid-9aa00329a92b0b2c.office.live.com/view.aspx/Graph%20Issue/ABAP^_Code.docx


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Date values not appearing correclty in the x-axis

Hi Kush

you could try adding this:

Dim myDate As String
myDate = Format(Date, "dd-mmm-yyyy")

so replace this:
..axes(xlCategory, xlprimary).axisTITLE.CHARACTERS.TEXT = "Date"

with
..axes(xlCategory, xlprimary).axisTITLE.CHARACTERS.TEXT = myDate

HTH

Mick


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart adds in extra date values on the X axis Pete Rooney Charts and Charting in Excel 7 May 2nd 23 11:43 AM
X-Axis Appearing in Plot Area Mike M.[_2_] Charts and Charting in Excel 2 October 8th 09 09:23 PM
Data appearing as Values Polochilde Excel Discussion (Misc queries) 4 February 28th 07 08:28 PM
Display Values under Date labels on the X-Axis... Bob Barnes Charts and Charting in Excel 1 October 7th 05 10:24 PM
How to insert X axis scale values next to axis and X axis grid lin vp23larry Charts and Charting in Excel 2 June 23rd 05 03:45 PM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"