我想要在图表区域中显示平均值、中位数和标准差,以防使用附加图例工具时无法示教方框Plot.Since自定义图例工具。
问题是,在我的底部Axis.Can之后,我无法将额外的图例放置在空白区域中,有人会帮助我吗?
发布于 2013-10-01 18:01:29
我认为您的问题产生是因为您需要重新绘制图表,然后再尝试使用ExtraLegend工具计算自定义位置。你可以做一些类似于我在下面的简单代码中所做的事情,其中我已经绘制了一个ExtraLegend工具align to original Legend:
Private Sub Form_Load()
TChart1.AddSeries scBox
TChart1.AddSeries scBox
TChart1.Series(0).FillSampleValues 5
TChart1.Series(1).FillSampleValues 5
TChart1.Legend.LegendStyle = lsValues
TChart1.Series(0).asBoxPlot.Box.Brush.Color = vbRed
TChart1.Series(1).asBoxPlot.Box.Brush.Color = vbBlue
TChart1.Tools.Add tcExtraLegend
TChart1.Tools.Items(0).asExtraLegend.Series = TChart1.Series(1)
'Use internal Repaint to calculate the position of Legend.
TChart1.Environment.InternalRepaint
With TChart1.Tools.Items(0).asExtraLegend.Legend
.CustomPosition = True
.Left = TChart1.Legend.Left
.Top = TChart1.Legend.ShapeBounds.Bottom + 10
End With
End Sub你能告诉我们我的建议代码是否能帮助你解决问题吗?
我希望威尔能帮上忙。
谢谢,
https://stackoverflow.com/questions/19090887
复制相似问题