Home |
Search |
Today's Posts |
#6
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I plot an XY (scatter) graph with two Y axes? | Charts and Charting in Excel | |||
Locking gridlines to be square - axes to same scale ? | Charts and Charting in Excel | |||
Create a custom chart, two stacked bars/month w/ two axes? | Charts and Charting in Excel | |||
CHART AxES TITLE | Excel Discussion (Misc queries) | |||
3D Chart with Continuous Data in all three Axes | Charts and Charting in Excel |