Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Any suggestions as to how I can accomplish a couple of things related to labels on data points in scatter chart?
1. I know how to either display them, not display them, or display them only if the number of labels on the chart is less than a specified integer. (Properties -> Presentation -> Labels on Datapoints check box & Max Labels Shown entry. Ideally I would like a button which will toggle the display off/on as the user sees fit. In effect, toggling the Labels on Datapoints check box setting.
2. When displayed I'd like to truncate the value of the dimension displayed to 8 characters like I can do in the Legend settings. (Yes, I could make a calculated dimension but some of them have the same first 8 characters so this solution doesn't help).
Thanks.
I don't know about changing the labels, but the user can turn them on/off with a macro.
Create a variable named vShowLabels.
sub ScatterLabels
set v = ActiveDocument.Variables("vShowLabels")
strShowLabels = v.GetContent.String
set chart = ActiveDocument.GetsheetObject("CH66")
set gp = chart.GetProperties
if strShowLabels = "Yes" then
gp.ChartProperties.ScatterLabelsInChart = false
v.SetContent "No",true
else
gp.ChartProperties.ScatterLabelsInChart = true
v.SetContent "Yes",true
end if
' gp.ChartProperties.ScatterLabelPosVertical = 0 'top
' gp.ChartProperties.ScatterLabelPosHorizontal = 5 'center
chart.SetProperties gp
end sub
I don't know about changing the labels, but the user can turn them on/off with a macro.
Create a variable named vShowLabels.
sub ScatterLabels
set v = ActiveDocument.Variables("vShowLabels")
strShowLabels = v.GetContent.String
set chart = ActiveDocument.GetsheetObject("CH66")
set gp = chart.GetProperties
if strShowLabels = "Yes" then
gp.ChartProperties.ScatterLabelsInChart = false
v.SetContent "No",true
else
gp.ChartProperties.ScatterLabelsInChart = true
v.SetContent "Yes",true
end if
' gp.ChartProperties.ScatterLabelPosVertical = 0 'top
' gp.ChartProperties.ScatterLabelPosHorizontal = 5 'center
chart.SetProperties gp
end sub
Works like a champ for the toggle. Thanks!
Any takers for #2, the truncation of the text that displays?