control.Calc

PurposeDoes all calculations for a chart without creating and painting it.
Parameter-
Return valueZero if successful or an element of the RMCError enumeration.
Remarks

This method is useful when you need certain informations about some objects of your chart (e.g. grid position) before it gets painted. If you want for example add an average line to a grid based chart call Calc after you've added all objects and series to your chart, immediately before you would call Draw. Then call CalcAvergae to retrieve the necessary informations, add a custom Line object as average line and draw the chart.

Example ' Add all necessary objects to your chart, then calculate it:
...
...
RMChartX1.Calc
' Now, calculate the average of the series:
RMChartX1.Region(1).BarSeries(1).CalcAverage nAverage, nXStart, nYStart, nXEnd, nYEnd
' Add a custom line object to mark the average:
RMChartX1.AddCustomObjectline
RMChartX1.CustomObjectline(1).SetProperties nXStart, nYStart, nXEnd, nYEnd, RMC_DASH_LINE, Green
' Now draw the chart:
RMChartX1.Draw True

See also the Single bar example in the VB demo project.