Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
XYscatter chart source
I am trying to set the x & y source data ranges for a SYScatter chart in VBA.
I use the following code to create the chart, but the x values are not used for the x-axis (the automatic x-axis is 1,2,3...n). ActiveChart.SetSourceData Source:=ActiveSheet.Range(Y_rngStr), _ PlotBy:=xlColumns With ActiveSheet.ChartObjects(1).Chart .ChartType = xlXYScatter I have tried everything I can think of and variations of previous newsgroup questions/answers without success. Any suggestions would be appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
XYscatter chart source
Mitch -
It might be helpful to know exactly what you have tried, and it might be helpful to provide a longer snippet of your code, etc. For example, even if your code is OK, if any of the cells in the X range are text instead of numbers, Excel uses 1,2,3,... for the X values. - Mike http://www.mikemiddleton.com "Mitch" wrote in message ... I am trying to set the x & y source data ranges for a SYScatter chart in VBA. I use the following code to create the chart, but the x values are not used for the x-axis (the automatic x-axis is 1,2,3...n). ActiveChart.SetSourceData Source:=ActiveSheet.Range(Y_rngStr), _ PlotBy:=xlColumns With ActiveSheet.ChartObjects(1).Chart .ChartType = xlXYScatter I have tried everything I can think of and variations of previous newsgroup questions/answers without success. Any suggestions would be appreciated! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
XYscatter chart source
Looks to me like you're using a range containing Y values (the range is
names Y_rngStr) to populate the chart. You need to use a range containing all your data in SetSourceData, or you need to populate the X and Y values, SeriesCollection(i).XValues and .Values, of one series at a time, as described he http://peltiertech.com/Excel/ChartsH...kChartVBA.html - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Mitch" wrote in message ... I am trying to set the x & y source data ranges for a SYScatter chart in VBA. I use the following code to create the chart, but the x values are not used for the x-axis (the automatic x-axis is 1,2,3...n). ActiveChart.SetSourceData Source:=ActiveSheet.Range(Y_rngStr), _ PlotBy:=xlColumns With ActiveSheet.ChartObjects(1).Chart .ChartType = xlXYScatter I have tried everything I can think of and variations of previous newsgroup questions/answers without success. Any suggestions would be appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
C#: XYScatter chart with smooth lines and no markers | Charts and Charting in Excel | |||
charting independent XYScatter graphs | Charts and Charting in Excel | |||
pie chart & column chart w/same source data | Charts and Charting in Excel | |||
How do you link chart source data when you copy the chart? | Charts and Charting in Excel | |||
Help with datapoints stack in XYScatter | Charts and Charting in Excel |