0
votes

I Want to Show Mean, Median and Standard Deviation in chart area in case of Box Plot.Since Custom Legend tool is not avaiable taught of using Extra Legend tool.

The problem is that I am not able to Position the extra legend in blank space after my bottom Axis.Can anyone help me in this.

1

1 Answers

0
votes

I think your problem is produced because you need repaint the Chart, before try to calculate the custom position the ExtraLegend Tool. You can do something similar as I do in next simple code, where I have drawn a ExtraLegend Tool 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

Could you tell us if my suggestion code help you to solve your problem?

I hope will helps.

Thanks,