A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Line Chart - show percent and value?



 
 
Thread Tools Display Modes
  #1  
Old November 15th, 2005, 03:35 PM
PK
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!


  #2  
Old November 15th, 2005, 04:34 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

You need to construct your labels in another worksheet range. For the
January Series 1 label it would look like

=B2&" ("&TEXT(B2/SUM(B2:B3),"0%))&")"

Then use one of these free Excel add-ins to apply the labels from the
worksheet range to the data series in the chart:

Rob Bovey's Chart Labeler, http://appspro.com
John Walkenbach's Chart Tools, http://j-walk.com/ss

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
774-275-0064
208-485-0691 fax

http://PeltierTech.com/
_______


PK wrote:

I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!


  #3  
Old November 15th, 2005, 05:58 PM
PK
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

Thanks Jon!

I am sure that would work, however this is my problem:

I am actually automating Excel from a MS Access database, and this
application will be distributed to many workstations which would not have the
add-ons.

Is there any way to do this without an add-on?






"Jon Peltier" wrote:

You need to construct your labels in another worksheet range. For the
January Series 1 label it would look like

=B2&" ("&TEXT(B2/SUM(B2:B3),"0%))&")"

Then use one of these free Excel add-ins to apply the labels from the
worksheet range to the data series in the chart:

Rob Bovey's Chart Labeler, http://appspro.com
John Walkenbach's Chart Tools, http://j-walk.com/ss

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
774-275-0064
208-485-0691 fax

http://PeltierTech.com/
_______


PK wrote:

I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!



  #4  
Old November 15th, 2005, 09:29 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

Sure, the code that the add-in uses to label the points can be run from
the automation routine in Access.

(Also, once the labels are created and linked to the cells, the workbook
does not need the add-in to display correctly.)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


PK wrote:

Thanks Jon!

I am sure that would work, however this is my problem:

I am actually automating Excel from a MS Access database, and this
application will be distributed to many workstations which would not have the
add-ons.

Is there any way to do this without an add-on?






"Jon Peltier" wrote:


You need to construct your labels in another worksheet range. For the
January Series 1 label it would look like

=B2&" ("&TEXT(B2/SUM(B2:B3),"0%))&")"

Then use one of these free Excel add-ins to apply the labels from the
worksheet range to the data series in the chart:

Rob Bovey's Chart Labeler, http://appspro.com
John Walkenbach's Chart Tools, http://j-walk.com/ss

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
774-275-0064
208-485-0691 fax

http://PeltierTech.com/
_______


PK wrote:


I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!



  #5  
Old November 15th, 2005, 09:39 PM
Ed Ferrero
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

Hi PK,

Sample Excel code to label chart points is:

Dim pts As Points
Dim LabelRange As Range
Dim stRow As Integer
Dim stCol As Integer
Dim i As Integer

' This example assumes that data and data labels are in columns

Set LabelRange = Range("B1:B6")

stRow = LabelRange.Row
stCol = LabelRange.Column

' you could prompt for chart name here
Set pts = ActiveSheet.ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Points

' now show the data label for each point and set the text
' to that in the selected range
For i = 1 To pts.Count
pts(i).ApplyDataLabels Type:=xlShowValue
pts(i).DataLabel.Text = "=Sheet1!R" & i + stRow - 1 & "C" & stCol
Next i

You should be able to automate from Access using something similar.

Ed Ferrero
http://edferrero.m6.net/


Thanks Jon!

I am sure that would work, however this is my problem:

I am actually automating Excel from a MS Access database, and this
application will be distributed to many workstations which would not have
the
add-ons.

Is there any way to do this without an add-on?






"Jon Peltier" wrote:

You need to construct your labels in another worksheet range. For the
January Series 1 label it would look like

=B2&" ("&TEXT(B2/SUM(B2:B3),"0%))&")"

Then use one of these free Excel add-ins to apply the labels from the
worksheet range to the data series in the chart:

Rob Bovey's Chart Labeler, http://appspro.com
John Walkenbach's Chart Tools, http://j-walk.com/ss

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
774-275-0064
208-485-0691 fax

http://PeltierTech.com/
_______


PK wrote:

I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data
labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!





  #6  
Old November 18th, 2005, 04:24 PM posted to microsoft.public.excel.charting
external usenet poster
 
Posts: n/a
Default Line Chart - show percent and value?

Ed - that is EXACTLY what I was looking for!!!! THANK YOU!!!!

Jon - Thanks for your help also!





"Ed Ferrero" wrote:

Hi PK,

Sample Excel code to label chart points is:

Dim pts As Points
Dim LabelRange As Range
Dim stRow As Integer
Dim stCol As Integer
Dim i As Integer

' This example assumes that data and data labels are in columns

Set LabelRange = Range("B1:B6")

stRow = LabelRange.Row
stCol = LabelRange.Column

' you could prompt for chart name here
Set pts = ActiveSheet.ChartObjects("Chart 1").Chart. _
SeriesCollection(1).Points

' now show the data label for each point and set the text
' to that in the selected range
For i = 1 To pts.Count
pts(i).ApplyDataLabels Type:=xlShowValue
pts(i).DataLabel.Text = "=Sheet1!R" & i + stRow - 1 & "C" & stCol
Next i

You should be able to automate from Access using something similar.

Ed Ferrero
http://edferrero.m6.net/


Thanks Jon!

I am sure that would work, however this is my problem:

I am actually automating Excel from a MS Access database, and this
application will be distributed to many workstations which would not have
the
add-ons.

Is there any way to do this without an add-on?






"Jon Peltier" wrote:

You need to construct your labels in another worksheet range. For the
January Series 1 label it would look like

=B2&" ("&TEXT(B2/SUM(B2:B3),"0%))&")"

Then use one of these free Excel add-ins to apply the labels from the
worksheet range to the data series in the chart:

Rob Bovey's Chart Labeler, http://appspro.com
John Walkenbach's Chart Tools, http://j-walk.com/ss

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
774-275-0064
208-485-0691 fax

http://PeltierTech.com/
_______


PK wrote:

I thought this would be easy, but I am really stumped!

I need to show the percentage in addition to the value in the data
labels
for a line chart.

Example,
January February
Series 1 5 6
Series 2 15 4

I would like the January data label for Series 1 to show 5 (25%)
I would like the January data label for Series 2 to show 15 (75%)

I would like the February data label for Series 1 to show 6 (60%)
I would like the February data label for Series 2 to show 4 (40%)

TIA FOR ANY HELP!






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.