Annex A, RChart Visual Builder

Copyright 2005, J4L Components (http://www.java4less.com)
Go bak to contents


 

Introduction

 

What is RChart Visual Builder

RChart Visual Builder is a tool for creating charts to be used with RChart. It is however optional , you don't have to use RChart Visual Builder if you don't want to. In this case you can still manually create the parameters for Rchart.

the benefits of using RChart Visual Builder are:

this will result in shorter learning and development times of charts.

 

Requirements

In order to run RChart Visual Builder you need JDK 1.2 or later (1.3, 1.4 ...)

Note: Swing is needed it to run RChart Visual Builder only, it is not needed for running RChart.

Note: Since RChart uses Swing, the fonts can look slightly different if you later run the chart using SWT.

 

About the evaluation version

If you are running the evaluation version of RChart Visual Builder you must be aware of these limitations:

 

Description

 

Starting RChart Visual Builder

In order to start the application you must execute bin/VisualBuilder.bat.

 

User Interface

The user interface is made of the following sections:

If you are familiar with the format of the parameters (color, fill styles ....) you can enter the value directly in the field, however RChart Visual Builder provides specific forms for selecting font, colors , line style and other types of parameters.

 

Limitations

When you build your chart using the Visual Builder you must take into account that the following features are not enabled inside the Builder:

 

Running the chart

Once your chart has been created you can:

Note that some of the parameters in your chart are constant, for example, your chart will always have a yellow background color. However some other parameters will be variable, for example the data to be plotted (parameter SERIE_DATA_*). You must of course change those parameters at runtime:

 

 

Tutorial

Create a line or bar chart, step by step

The following steps will show you how to create a line chart that uses dates in the x axis:

  1. Start RChart Visual Builder
  2. Create a new chart with menu File->New.
  3. Click on the Chart node of the components tree (top right corner of the window).
  4. Enter desired size of the chart in the Area's width and height parameters. For example 400,400.
  5. Enter a title for you chart in the "Text of the title" field. For example "My first chart".
  6. Proceed now with the X Axis
  7. Click on the X Axis node of the components tree.
  8. Enter title for the X Axis in the "Text of the X label". For example "Date".
  9. Enter initial date "X initial date" , for example "23-12-2001".
  10. Enter "d" in the "X date step". In this way, each tick will stand for 1 day.
  11. Enter 7 in the "X big tick interval" so that you get 1 big tick every 7 days.
  12. Proceed now with the YAxis
  13. Click on the Y Axis node of the components tree.
  14. Enter 0 in the "Y Min" field.
  15. Enter "10" in the "Y auto ticks" so that you get only 10 ticks on the Y axis.
  16. Set "Y axis integer" to "Yes", in order to avoid decimal values on the Y Axis labels.
  17. Proceed now with the Data to be plotted
  18. Click on the Serie 1 node of the components tree
  19. Enter a name for the serie in the field "Name of the serie". For example "Sales".
  20. Enter the values to be plotted in the "Data" field. For example: "10|23|45|24|45|67|86|23|43" .
  21. Set Type to LINE in order to get a line chart or BAR in order to get a bar chart.
  22. Select now color of the line in the field:
  23. click on the Build button.

congratulations!, you have created your first chart, you can now change some other parameters like colors, images, line styles or fonts in order to make this simple chart look a bit nicer.

 

Create a pie chart, step by step

The following steps will show you how to create a pie chart:

  1. Start RChart Visual Builder
  2. Create a new chart with menu File->New.
  3. Click on the Chart node of the components tree (top right corner of the window).
  4. Enter desired size of the chart in the Area's width and height parameters. For example 400,400.
  5. Enter a title for you chart in the "Text of the title" field. For example "My first chart".
  6. Proceed now with the Data to be plotted
  7. Click on the Serie 1 node of the components tree.
  8. Enter a name for the serie in the field "Name of the serie". For example "Test".
  9. Set Type to PIE.
  10. Set now the values in the "Data" field, for example "10|45|67". This will be the values for each item of the pie.
  11. Enter now the names of the items.
  12. Enter the name in the "Item name 1" field of the "PieChart" section of the "Serie 1", for example "Item A".
  13. Enter the name in the "Item name 2" field of the "PieChart" section of the "Serie 2", for example "Item B".
  14. Enter the name in the "Item name 3" field of the "PieChart" section of the "Serie 3", for example "Item C".
  15. Enter now the colors for the items of the pie.
  16. Select a color in the "Item style 1" field of the "PieChart" section of the "Serie 1"
  17. Select a color in the "Item style 2" field of the "PieChart" section of the "Serie 2"
  18. Select a color in the "Item style 3" field of the "PieChart" section of the "Serie 3"
  19. click on the Build button.

congratulations!, you have created your first chart, you can now change some other parameters; Click on the "Piechart" node of the components tree to change the aspect of the pie.

 

Examples

The subdirectory "data/examples" contains several files you can load into RChart Visual Builder. We recommend you to use this examples as start point for your own charts.