Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is there a property to get the values for a point in a chart series?

I want to loop through data points in an x-y chart series and use the X and
Y values to set the Left and Top positions of some arrows I have placed on
the chart. I've got the regression formulas for converting the coordinates
of each data point into Left and Top values. I just can't figure out how to
access the X-value and Y-value of each point during the loop so that I can
plug them into my conversion formulas. Is there no property to get the
actual values of a point in a chart series?

Bruce


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Is there a property to get the values for a point in a chart series?

Hi Bruce,

try something similar to this (with appropriate changes to suit your
needs):
Worksheets(1).ChartObjects(1).Chart.SeriesCollecti on(1).Points(1)

or see help for points collection object.

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is there a property to get the values for a point in a chart series?

"Ivan Raiminius" wrote
: Hi Bruce,
:
: try something similar to this (with appropriate changes to suit your
: needs):
: Worksheets(1).ChartObjects(1).Chart.SeriesCollecti on(1).Points(1)
:
: or see help for points collection object.
:
: Regards,
: Ivan


Hi Ivan,

I've been through all the help pages I can think of and poked around in the
Object Browser, and even hunted Google for a while. I've tried various
things but can't get at the values themselves through the Points. They must
have just left that property off the list, since it's not too hard for
someone to go get the values in the underlying data. I thought I might be
missing something easy and obvious.

Thanks for your suggestion anyway,
Bruce


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Is there a property to get the values for a point in a chartseries?

Here is some code to get at the values.
You can either dump all the values to a variant array or use the
worksheet INDEX() Function.

Sub X()

Dim vntXValues As Variant
Dim vntYValues As Variant
Dim lngItem As Long

' load values into array
With ActiveChart
With .SeriesCollection(1)
vntXValues = .XValues
vntYValues = .Values
End With
End With
For lngItem = LBound(vntXValues) To UBound(vntXValues)
Debug.Print "Point "; lngItem, "X="; _
vntXValues(lngItem), "Y="; vntYValues(lngItem)
Next

Debug.Print

' Index reference values
With ActiveChart
With .SeriesCollection(1)
For lngItem = 1 To .Points.Count
Debug.Print "Point "; lngItem, _
"X="; _
Application.WorksheetFunction.Index(.XValues, lngItem), _
"Y="; _
Application.WorksheetFunction.Index(.Values, lngItem)
Next
End With
End With

End Sub

Cheers
Andy

Bruce Cooley wrote:
"Ivan Raiminius" wrote
: Hi Bruce,
:
: try something similar to this (with appropriate changes to suit your
: needs):
: Worksheets(1).ChartObjects(1).Chart.SeriesCollecti on(1).Points(1)
:
: or see help for points collection object.
:
: Regards,
: Ivan


Hi Ivan,

I've been through all the help pages I can think of and poked around in the
Object Browser, and even hunted Google for a while. I've tried various
things but can't get at the values themselves through the Points. They must
have just left that property off the list, since it's not too hard for
someone to go get the values in the underlying data. I thought I might be
missing something easy and obvious.

Thanks for your suggestion anyway,
Bruce



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is there a property to get the values for a point in a chart series?

"Andy Pope" wrote in message
...
: Here is some code to get at the values.
: You can either dump all the values to a variant array or use the
: worksheet INDEX() Function.


Andy,

Good ideas. I'll see if I can work one of these approaches into my code.
Thanks!

Bruce




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Is there a property to get the values for a point in a chart series?

Hi Bruce,

maybe this is the solution:

http://www.j-walk.com/ss/excel/tips/tip83.htm

Regards,
Ivan

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Is there a property to get the values for a point in a chart series?

"Ivan Raiminius" wrote in message
oups.com...
: Hi Bruce,
:
: maybe this is the solution:
:
: http://www.j-walk.com/ss/excel/tips/tip83.htm
:
: Regards,
: Ivan
:

That article certainly validates my frustration. John's solution looks
interesting and elaborate, and if I can't get one of Andy's methods to work
for me I will try to work this into my code. I have had other things to
work on, so I haven't been able to deal with this particular problem since
my last post.

Bruce


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
unable to set the values property of the series class BHatMJ Excel Discussion (Misc queries) 4 July 10th 09 03:46 PM
Excel Chart Series Values Property Size Limitation Pete Charts and Charting in Excel 9 January 14th 08 03:03 PM
Unable to set the Values property of the Series class rafael garcia Charts and Charting in Excel 1 September 25th 06 04:31 PM
Series point on a chart Anthony Blackburn Excel Discussion (Misc queries) 2 August 7th 06 04:26 PM
Setting the Values Property of the Series Class Alex A Excel Programming 2 January 30th 04 08:55 PM


All times are GMT +1. The time now is 09:07 AM.

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

About Us

"It's about Microsoft Excel"