Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Strange behavior Chart.SeriesCollection(n).Values property

Hello group,

I encountered strange behavior with the Chart.SeriesCollection(n).Values and
XValues property when using floating point arrays.

When this procedure is run, the integer array works fine, but the floating
point array exits with the error message: "Unable to set the XValues
property of the Series class". The strange part is: if you decrease the
array size, it works, if you decrease the decimals, it works. The error
remains if the array is typed.

Anybody knows what's going on?

Thanks.

Emile

Sub drawAxis()

Dim xAxis(1 To 40), yAxis(1 To 40), n As Integer

For n = 1 To 40
xAxis(n) = 0.005
yAxis(n) = 5
Next n

Chart1.SeriesCollection(1).Values = yAxis
Chart1.SeriesCollection(1).XValues = xAxis

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Strange behavior Chart.SeriesCollection(n).Values property

Hi Emile,

The problem is that there is a limit to the length of the data series
formula. Integer values are ok but the floating point exceeds the
length. Therefore as you have discovered reducing the decimals or number
of points will allow it to work again.

Check out Jon Peltier's page for more detail.
http://peltiertech.com/Excel/ChartsH...ChartData.html

Cheers
Andy

Emile van Mierlo wrote:
Hello group,

I encountered strange behavior with the Chart.SeriesCollection(n).Values and
XValues property when using floating point arrays.

When this procedure is run, the integer array works fine, but the floating
point array exits with the error message: "Unable to set the XValues
property of the Series class". The strange part is: if you decrease the
array size, it works, if you decrease the decimals, it works. The error
remains if the array is typed.

Anybody knows what's going on?

Thanks.

Emile

Sub drawAxis()

Dim xAxis(1 To 40), yAxis(1 To 40), n As Integer

For n = 1 To 40
xAxis(n) = 0.005
yAxis(n) = 5
Next n

Chart1.SeriesCollection(1).Values = yAxis
Chart1.SeriesCollection(1).XValues = xAxis

End Sub



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Strange behavior Chart.SeriesCollection(n).Values property

Hallo Andy,

Thanks for replying so quickly.

The problem is that there is a limit to the length of the data series
formula. Integer values are ok but the floating point exceeds the
length. Therefore as you have discovered reducing the decimals or number
of points will allow it to work again.


I changed the code: now it doesn't set the XValues and Values directly, but
it sets a worksheet name instead, and the chart points to the worksheet
names (see below). This works without limitation. Do you perhaps know why
this makes a difference? The number of points is the same. Is it solely the
fact that the Formula cannot be too long?

Thanks again.

Emile

Sub drawAxis()

Dim xAxis(1 To 40), yAxis(1 To 40), n As Integer

For n = 1 To 40
xAxis(n) = 0.005
yAxis(n) = 5
Next n

ThisWorkbook.Names.Add "xAxis", xAxis
ThisWorkbook.Names.Add "yAxis", yAxis

End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Strange behavior Chart.SeriesCollection(n).Values property

Hi,

Yes it a limit on the series formula text length.

If you use the array approach, the integer version so I works, now go to
the chart and select the data series. In the formula bar you will see
the values explicitly entered. Quite a lengthy formula.
Do the same for a range and you will see only the range reference.

There are other limitations within a chart and even with a range these
can be reached.

Cheers
Andy

Emile van Mierlo wrote:
Hallo Andy,

Thanks for replying so quickly.


The problem is that there is a limit to the length of the data series
formula. Integer values are ok but the floating point exceeds the
length. Therefore as you have discovered reducing the decimals or number
of points will allow it to work again.



I changed the code: now it doesn't set the XValues and Values directly, but
it sets a worksheet name instead, and the chart points to the worksheet
names (see below). This works without limitation. Do you perhaps know why
this makes a difference? The number of points is the same. Is it solely the
fact that the Formula cannot be too long?

Thanks again.

Emile

Sub drawAxis()

Dim xAxis(1 To 40), yAxis(1 To 40), n As Integer

For n = 1 To 40
xAxis(n) = 0.005
yAxis(n) = 5
Next n

ThisWorkbook.Names.Add "xAxis", xAxis
ThisWorkbook.Names.Add "yAxis", yAxis

End Sub



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
Strange behavior Ritchie Excel Discussion (Misc queries) 2 September 26th 06 02:21 AM
SeriesCollection Values Property Oddity Greg Wilson Charts and Charting in Excel 4 December 3rd 05 04:26 AM
Strange behavior DeRussie Setting up and Configuration of Excel 4 November 26th 05 05:41 PM
Strange behavior. Wiley Coyote Excel Discussion (Misc queries) 7 October 18th 05 04:35 PM
format text string for SeriesCollection.Name property Rajdeep Excel Programming 0 March 4th 04 01:11 AM


All times are GMT +1. The time now is 01:51 AM.

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"