fboehlandt
Active Member
- Joined
- Sep 9, 2008
- Messages
- 334
Hello everyone,
does the property PlotArea.InsideLeft change with respect to the zoom level? I am trying to determine the distance from chart edge to the inside left edge of the plot area. I understand the values returned are xx pts. To put this into context: I am trying to fill the area inside points defined in a XY-scatterdiagram. The following is part of the code that I am using (myCht is the relevant chart in chartobjects):
This works fine at zoom level 100%. However, at zoom 75%, for instance, the fill area is not a perfect match (it appears as slightly jolted). I am guessing it may have to do with values marked red in the code above. If so, is there a workaround to achieve a perfect fill at any zoom level. many thanks in advance
does the property PlotArea.InsideLeft change with respect to the zoom level? I am trying to determine the distance from chart edge to the inside left edge of the plot area. I understand the values returned are xx pts. To put this into context: I am trying to fill the area inside points defined in a XY-scatterdiagram. The following is part of the code that I am using (myCht is the relevant chart in chartobjects):
Code:
[COLOR=red]Xleft = myCht.PlotArea.InsideLeft
Xwidth = myCht.PlotArea.InsideWidth
Ytop = myCht.PlotArea.InsideTop
Yheight = myCht.PlotArea.InsideHeight
[/COLOR]Xmin = myCht.Axes(1).MinimumScale
Xmax = myCht.Axes(1).MaximumScale
Ymin = myCht.Axes(2).MinimumScale
Ymax = myCht.Axes(2).MaximumScale
Set mySrs = myCht.SeriesCollection(1)
Npts = mySrs.Points.Count
'first point
Xnode = Xleft + (mySrs.XValues(Npts) - Xmin) * Xwidth / (Xmax - Xmin)
Ynode = Ytop + (Ymax - mySrs.Values(Npts)) * Yheight / (Ymax - Ymin)
Set myBuilder = myCht.Shapes.BuildFreeform(msoEditingAuto, Xnode, Ynode)
'remaining points
For Ipts = 1 To Npts
Xnode = Xleft + (mySrs.XValues(Ipts) - Xmin) * Xwidth / (Xmax - Xmin)
Ynode = Ytop + (Ymax - mySrs.Values(Ipts)) * Yheight / (Ymax - Ymin)
myBuilder.AddNodes msoSegmentLine, msoEditingAuto, Xnode, Ynode
Next
This works fine at zoom level 100%. However, at zoom 75%, for instance, the fill area is not a perfect match (it appears as slightly jolted). I am guessing it may have to do with values marked red in the code above. If so, is there a workaround to achieve a perfect fill at any zoom level. many thanks in advance