Example Code
Simple examples of Openchart2 implementations
Openchart2 is capable of performing a variety of charting tasks. Approximatrix has provided below some simple, well-commented source code to aid developers in implementing charting in their software.
| Example | Description |
|---|---|
| PieChart.java | Taken from Tutorial #1, this sample applet shows how to create a simple pie chart. |
| BarChart.java | Generates a vertical bar chart, as shown in Tutorial #2. |
| RandomChart.java | Generates a Swing application that shows the ease with which data series can be added and removed from a scatter plot. |
| SVGLineChart.java | A line chart example that shows Openchart2's ability to work in unison with the Batik SVG Generator to enable saving charts as vector graphics. |
| UpdatingChart.java | A simple scatter plot that demonstrates updating dynamic data using the MultiScatterDataModel and a repeating, timed thread. |
| ExpensiveChart.java | Example using the BufferedChart and BufferedChartPanel components introduced in version 1.2 to perform rendering on a separate thread for complicated plots. |
| RadarPlotExample.java | Creates a dialog containing a simple example of a Radar plot generated by Openchart2 |
Approximatrix is always open to suggestions for other examples. Please feel free to suggest another or request further help on the Support Forums.