Basic concepts

Note: The coding examples and technical instructions in the helpfile are valid for using RMChart with Visual Basic 6. If you use it with other development systems, other coding styles and methods for using ActiveX controls may apply, dependend on the development system you use.

RMChart is a standard WINDOWS ActiveX control. To use it in your project it must be registered in your WINDOWS system (which should be done by the setup routine) and you must add it in VB via Project->Components to your project. After applying an instance of the control on the form, where the chart shall be painted, you may set some basic properties of the control (BackColor, Style, Width and Height) in design mode, but all other properties must be defined during runtime.

Your programm can have up to 20 instances of RMChart at the same time running. Each chart consits of at least one Region and can have a maximum number of six regions. A region is an user-defined aerea inside the chart control's boundary, which is defined as a rectangle with Left, Top, Width and Height. Each region can have either one grid-based chart with 1 to 15 series (e.g. Bar series or Line series, whereas each series can have as many data points as needed) or one XY scatter chart, also with 1 to 15 series or one non-gridbased chart with an unlimited number of data values. Furthermore each region can have optionally a Caption, a Footer and a Legend.
For a better understanding of this concept load the following example files into RMCDesigner:

  • simplebar.rmc: This is a simple chart with one region and a grid-based chart. The region owns a caption, a grid, a data axis, a label axis and a bar series.
  • 2 regions.rmc: This one has two regions, both with grid-based series. The upper region has a RMC_HighLowSeries and a caption, the lower a RMC_VolumeBarSeries.
  • More sophisticated is this one: 4 regions.rmc. The both regions in the upper half have each one grid-based series, the region in the lower left owns a non-grid based series, the one in the lower right again has two grid-based series, whereas tha bars are connected to the left, the line to the right data axis.
These are the steps you have to go when working with RMChart:
  • Apply an instance of the control onto a form. Set the basic properties of the control either in design mode or in the code section of your form at runtime.
  • Add a region to the chart with control.AddRegion, set the properties for the region.
  • Optional: Add a caption to the region with control.Region(n).AddCaption and set the desired properties.
  • Optional: Add a legend to the region with control.Region(n).AddLegend and set the properties for the legend.

Now you have to decide wether you want a grid-based chart (Bar, Line etc.), a XY scatter chart or a non-grid based chart (Pie, Donut etc.). In case of a grid-based or a XY scatter chart:

In case of a grid-based chart: In case of a XY scatter chart:
  • Add a X-axis with control.Region(n).AddXAxis and a
  • Y-axis with
    control.Region(n).AddYAxis, set the properties for the axes. You can have two indepentend pairs of X- and Y-axes.
    Impportant: X and Y axes must always have a counterpart on the other side, they can only exist as a pair of axes. It's not possible for example to have one X axis and two Y axes. For each X axis must exsit a Y axis, for each Y axis a X axis.
  • Add one or more XY series with control.Region(n).AddXYSeries, set the properties and pass the data values to the series.
In case of a non-grid based chart:

In a final step you must decide wether you want to display the chart on the screen (call control.Draw), if you want to save it without drawing into a file (call control.Draw2File) or if you want to print it without drawing (call control.Draw2Printer). Note: In case you display the chart: as long as the chart is visible on the form you can call at any time control.Draw2File to save or control.Draw2Printer to print the chart.