ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Applying data label in VB (https://www.excelbanter.com/excel-programming/343946-applying-data-label-vbulletin.html)

Barb Reinhardt

Applying data label in VB
 
I believe I've defined some data labels, but need to know how to apply them
to a particular point. Any suggestions. I've not found anything that I
can decipher with a Google Search.

I'd like to apply a data label to the point plotted with this.

With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
End With

Also, I need to know how to center the data label above and below the point
(need two different methods).

Thanks,
Barb Reinhardt



Barb Reinhardt

Applying data label in VB
 
I've got this snippet now:

With .Points(idxPt)
If Len(label) < 0 Then
.HasDataLabel = True
.DataLabel.Text = label
Else
.HasDataLabel = True
.DataLabel.Text = ""
End If
End With


If Fail = 1 Then
With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
.ApplyDataLabels Type:=xlDataLabelsShowLabel, _
AutoText:=True, LegendKey:=False
End With
Else

With .Points(idxPt)
.MarkerBackgroundColorIndex = 2
.MarkerForegroundColorIndex = 5
.MarkerStyle = xlSquare
.MarkerSize = 7
End With
End If

I'm getting the X axis label displayed as the label and I need to know how
to get it to display the value defined by "label".

"Barb Reinhardt" wrote in message
...
I believe I've defined some data labels, but need to know how to apply them
to a particular point. Any suggestions. I've not found anything that I
can decipher with a Google Search.

I'd like to apply a data label to the point plotted with this.

With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
End With

Also, I need to know how to center the data label above and below the
point (need two different methods).

Thanks,
Barb Reinhardt




Barb Reinhardt

Applying data label in VB
 
Figured it out. Thanks anyway!

"Barb Reinhardt" wrote in message
...
I've got this snippet now:

With .Points(idxPt)
If Len(label) < 0 Then
.HasDataLabel = True
.DataLabel.Text = label
Else
.HasDataLabel = True
.DataLabel.Text = ""
End If
End With


If Fail = 1 Then
With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
.ApplyDataLabels Type:=xlDataLabelsShowLabel, _
AutoText:=True, LegendKey:=False
End With
Else

With .Points(idxPt)
.MarkerBackgroundColorIndex = 2
.MarkerForegroundColorIndex = 5
.MarkerStyle = xlSquare
.MarkerSize = 7
End With
End If

I'm getting the X axis label displayed as the label and I need to know how
to get it to display the value defined by "label".

"Barb Reinhardt" wrote in message
...
I believe I've defined some data labels, but need to know how to apply
them to a particular point. Any suggestions. I've not found anything
that I can decipher with a Google Search.

I'd like to apply a data label to the point plotted with this.

With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
End With

Also, I need to know how to center the data label above and below the
point (need two different methods).

Thanks,
Barb Reinhardt






exceluserforeman

Applying data label in VB
 


"The best results come from within." A. Non

l
"Barb Reinhardt" wrote:

Figured it out. Thanks anyway!

"Barb Reinhardt" wrote in message
...
I've got this snippet now:

With .Points(idxPt)
If Len(label) < 0 Then
.HasDataLabel = True
.DataLabel.Text = label
Else
.HasDataLabel = True
.DataLabel.Text = ""
End If
End With


If Fail = 1 Then
With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
.ApplyDataLabels Type:=xlDataLabelsShowLabel, _
AutoText:=True, LegendKey:=False
End With
Else

With .Points(idxPt)
.MarkerBackgroundColorIndex = 2
.MarkerForegroundColorIndex = 5
.MarkerStyle = xlSquare
.MarkerSize = 7
End With
End If

I'm getting the X axis label displayed as the label and I need to know how
to get it to display the value defined by "label".

"Barb Reinhardt" wrote in message
...
I believe I've defined some data labels, but need to know how to apply
them to a particular point. Any suggestions. I've not found anything
that I can decipher with a Google Search.

I'd like to apply a data label to the point plotted with this.

With .Points(idxPt)
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 3
.MarkerStyle = xlSquare
.MarkerSize = 7
End With

Also, I need to know how to center the data label above and below the
point (need two different methods).

Thanks,
Barb Reinhardt








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com