#1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default 'Ray' chart

I have created a ray or radial chart which has data from the origin
(0,0) to a point at (x,y).

This creates something like the hands of a clock but with many more
'hands' of different lengths.

At the end of each ray I have a data label.

Is it possible to line-up the text as an extension of the ray? i.e.
put the text at an angle

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default 'Ray' chart

You can change the orientation of the text to any angle between -90 and +90,
and you can position the labels pretty much anywhere within the plot area.
The orientation cannot be done automatically, but I had a project which
would update the label orientation whenever the chart source data changed.

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


wrote in message
ups.com...
I have created a ray or radial chart which has data from the origin
(0,0) to a point at (x,y).

This creates something like the hands of a clock but with many more
'hands' of different lengths.

At the end of each ray I have a data label.

Is it possible to line-up the text as an extension of the ray? i.e.
put the text at an angle



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default 'Ray' chart

The orientation cannot be done automatically, but I had a project which
would update the label orientation whenever the chart source data changed.

- Jon



From the two points I can calculate the angle for the label ...


How did you change the label orientation to match the source data?
(you say it cannot be automatic but then say
'update ...orientation'?).

Steve

  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default 'Ray' chart

I had a VBA procedure which ran when the cells changed. It was fired by the
Worksheet_Change event. So it wasn't done automatically within the Excel UI,
but it was done automatically with a little help from VBA.

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


wrote in message
oups.com...
The orientation cannot be done automatically, but I had a project which
would update the label orientation whenever the chart source data
changed.

- Jon



From the two points I can calculate the angle for the label ...


How did you change the label orientation to match the source data?
(you say it cannot be automatic but then say
'update ...orientation'?).

Steve



  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default 'Ray' chart

Is this complex code? I have precious little experience in VB and
would need some hints to get started!



  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default 'Ray' chart

Hi,

Here is my version of the code to radiate your text labels.
Assumes you 1 series has data labels applied. Select chart and run code

Sub MakeSpokeText()

Dim lngPoint As Long
Dim sngX As Single
Dim sngY As Single
Dim dblPI As Double
Dim sngAngle As Single

dblPI = Application.WorksheetFunction.Pi

With ActiveChart
With .SeriesCollection(1)
For lngPoint = 1 To .Points.Count
sngX = Application.WorksheetFunction.Index( _
..XValues, 1, lngPoint)
sngY = Application.WorksheetFunction.Index( _
..Values, 1, lngPoint)
If IsNumeric(sngX) And IsNumeric(sngY) Then
If sngX = 0 And sngY = 0 Then
' ignore center points
Else
sngAngle = Atn(sngY / sngX) * (180 / dblPI)
.Points(lngPoint).DataLabel.Orientation = _
sngAngle
End If
End If
Next
End With
End With

End Sub

Cheers
Andy

wrote:
Is this complex code? I have precious little experience in VB and
would need some hints to get started!

  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 7
Default 'Ray' chart

Great!

Thanks

Steve

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
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" roadsidetree Charts and Charting in Excel 15 June 2nd 09 10:53 AM
chart from pivot data does not update x-axis bar chart values - bug jason gers Excel Discussion (Misc queries) 0 April 3rd 07 06:34 PM
Double-stacked Bar Chart WITH a Secondary Y Axis Line chart? lpenndorf Charts and Charting in Excel 1 February 7th 07 04:32 PM
Huge differences in chart values screws my bar chart scale up. Sirritys Charts and Charting in Excel 2 June 13th 06 10:33 AM
Excel chart - how to assign the file name in the chart title? TGreen Charts and Charting in Excel 1 August 16th 05 10:35 AM


All times are GMT +1. The time now is 02:29 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"