Accessing Points in a Line Chart

  • Thread starter Thread starter Techno_Dex
  • Start date Start date
T

Techno_Dex

This is a cross post, as I had been pointed to this group and an alt. after
I had posted originally. Hoping this one can help.

How do I access the Points in a Chart of type Line? I'm wanting to display
the Values at each point and modify various aspects like size and color. So
far I have not found the proper combination of properties to access these
point, and the access method is different for every chart type. Any ideas?

I guess what I'm really asking is how do I access the Point Labels on a Line
Chart.
 
Hi,

Using the macro record generated this code when changing 2 points on a
line series.

You can edit the code to get rid of all the select/selection stuff.


ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(3).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
With Selection
.MarkerBackgroundColorIndex = 6
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlCircle
.MarkerSize = 9
.Shadow = False
End With
ActiveChart.SeriesCollection(1).Points(5).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
With Selection
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlTriangle
.MarkerSize = 5
.Shadow = False
End With

Cheers
Andy
 
Correct me if I'm wrong, but it this code looks like it's modifying the
Markers, not the Labels/Values that those Markers represent? (i.e. If the
first Marker is a value of 5.4, will this code actuallly set the
background/forground color for the value 5.4 or does it set the
background/forground color for the Circle/Triangle Marker that represents
the point 5.4)
 
Yes, you are correct. But, given that Andy told you how he got the
necessary code, you could have done the same with the data label. Use the
macro recorder (Tools | Macro > Record new macro...), edit the data label
using the GUI, turn off the recorder, and switch to the VBE. XL will give
you the appropriate code.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

nospamchurst@osi- said:
Correct me if I'm wrong, but it this code looks like it's modifying the
Markers, not the Labels/Values that those Markers represent? (i.e. If the
first Marker is a value of 5.4, will this code actuallly set the
background/forground color for the value 5.4 or does it set the
background/forground color for the Circle/Triangle Marker that represents
the point 5.4)
 
Back
Top