Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set Xvalues to an array of date, but the x-scale not correct
Sorry for missing information.
It is excel 97, line curve (the default one) When i set xvalues (say "=Sheet1!$A$2:$A$5") in chart wizard, it is ok. But when i set it by program or in macro's debug window, not ok. "Tom Ogilvy" wrote in message ... Are you using a scatter plot. If not, that is the only type chart that would do what you describe. -- Regards, Tom Ogilvy Alan Pong wrote in message om... a = array(cdate("2003/12/5"), cdate("2008/9/3") ,cdate("2013/9/2"), cdate("2033/8/28")) activesheet.chartobjects(1).chart.seriescollection (1).xvalues=a b = array(.93, 3.26 , 4.35, 5.21) activesheet.chartobjects(1).chart.seriescollection (1).values=b what i see is that the x distance between two consecutive points is uniform. (the fourth point should be more far away.) any cue? thanks. rgds. alan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set Xvalues to an array of date, but the x-scale not correct
Alan -
If the chart is a Line type, it may have applied a purely Category axis type. You can change this to a time-scale axis type as follows: ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlTimeScale Or you can convert the chart to an XY Scatter type, as Tom suggested: ActiveChart.ChartType = xlXYScatterLines - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Alan Pong wrote: Sorry for missing information. It is excel 97, line curve (the default one) When i set xvalues (say "=Sheet1!$A$2:$A$5") in chart wizard, it is ok. But when i set it by program or in macro's debug window, not ok. "Tom Ogilvy" wrote in message ... Are you using a scatter plot. If not, that is the only type chart that would do what you describe. -- Regards, Tom Ogilvy Alan Pong wrote in message .com... a = array(cdate("2003/12/5"), cdate("2008/9/3") ,cdate("2013/9/2"), cdate("2033/8/28")) activesheet.chartobjects(1).chart.seriescollect ion(1).xvalues=a b = array(.93, 3.26 , 4.35, 5.21) activesheet.chartobjects(1).chart.seriescollect ion(1).values=b what i see is that the x distance between two consecutive points is uniform. (the fourth point should be more far away.) any cue? thanks. rgds. alan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set Xvalues to an array of date, but the x-scale not correct
Thanks Jon and Tom!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date(Year,Month,Day) not returnign correct date | Excel Discussion (Misc queries) | |||
Clipart will not scale with array of cells | New Users to Excel | |||
Array formula correct but end up with 0 for answer | Excel Discussion (Misc queries) | |||
date auto correct | Excel Discussion (Misc queries) | |||
date scale problem | Excel Discussion (Misc queries) |