LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Radixa
 
Posts: n/a
Default

Ok, thanks Tushar.

Here is the result to write labels on the graph :
(I get the label from a comment on the cell)

================================
iPlotAreaInsideWidth = ActiveChart.PlotArea.InsideWidth
iPlotAreaInsideHeight = ActiveChart.PlotArea.InsideHeight
vYMax = ActiveChart.Axes(xlValue, CInt(sYAxe)).MaximumScale
iIndexMax = UBound(ActiveChart.SeriesCollection(iSeriesIndex). Values)

iIndex = 1
For Each oCell In oRange
If Not (oCell.Comment Is Nothing) Then
vYTemp = oCell.Value
iXlabel = iIndex * iPlotAreaInsideWidth / iIndexMax
iYlabel = ((vYMax - vYTemp) * iPlotAreaInsideHeight /
vYMax) - 10

DrawComment oCell.Comment.Text, iXlabel, iYlabel, 10
End If
iIndex = iIndex + 1
Next oCell

....

Function DrawComment(ByVal strTexte, intX, intY, intFontSize)
Dim myChar As Object

Set myChar = ActiveChart.Shapes.AddLabel(msoTextOrientationHori zontal,
intX, intY, 0#, 0#) _
.TextFrame.Characters
With myChar
.Text = strTexte
.Font.Name = "Arial"
.Font.FontStyle = "Normal"
.Font.Size = intFontSize
.Font.ColorIndex = xlAutomatic
End With
End Function
================================

It works fine.

Regards
Rad.


"Tushar Mehta" a écrit dans le
message de om...
Use the Axis object's maximumscale (or minimumscale) property

For example, in the immediate window:
?activechart.Axes(xlvalue).maximumscale

--
Regards,

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

In article ,
says...
Hi all,

I want to get the max value for the Y and X axes on a plotArea, not the

max
values for series on this chart.

Is it possible with VBA ?

TIA
Rad





 
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
How do I plot an XY (scatter) graph with two Y axes? PeterAtLufbra Charts and Charting in Excel 2 April 4th 23 10:44 AM
Locking gridlines to be square - axes to same scale ? John Mansfield Charts and Charting in Excel 0 April 7th 05 03:17 PM
Create a custom chart, two stacked bars/month w/ two axes? Oscar Charts and Charting in Excel 1 March 21st 05 11:07 PM
CHART AxES TITLE yorkielover02 Excel Discussion (Misc queries) 1 February 3rd 05 09:31 PM
3D Chart with Continuous Data in all three Axes Barb Reinhardt Charts and Charting in Excel 3 January 10th 05 07:09 PM


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