I developed wxFreeChart to provide wxWidgets the flexible and comprehensive framework for building charting applications with support of the various chart types, with various data sources, and control of the most visual representation attributes (fonts, axes configuration, titles, background, etc). wxFreeChart is using model-controller-view pattern. It’s design allows to easily integrate various data sources (files, sensors, calculated by application, database, received by network, etc). Data source is abstract, e.g. it’s no sense for framework of how data received. Rendering system enables application developer to make many different chart types with the same approach. Almost every aspect of visual representation can be controlled, this allow you, for example, to make as many axes, as you need, change their colors and fonts, set markers and their appearance, set gradient backgrounds, change legend, chart title and it’s font and color. wxFreeChart is like a set of many building blocks, that developer configure and links them together. Project has wxWidgets license. You can use wxFreeChart in your applications (even commercial) for free.
Supported chart types
wxFreeChart supports the following chart types:
- Line XY charts.
- Histogram XY charts.
- Area XY charts.
- Bar charts.
- Stacked bar charts.
- Layered bar charts.
- OHLC bars financial charts.
- OHLC candlesticks financial charts.
- Bubble charts.
- Gantt charts.
- Dynamic charts.
- Unlimited amount of axes.
- Gradient backgrounds and bars.
- Bars and candlestick colors can be controlled by various conditions (e.g. indicators, etc).
- Zoom and pan for charts.
Main concepts are:
Dataset is a data access interface. It's a model in Model-Controller-View pattern. It doesn't hold data by itself, it only defines data interface. There are different implementations (they are described below). You can write your own Dataset implementation, if noone provided classes fits your needs.
Datasets can be following types:
- XYDataset. Provides data for charts, based on XY coordinates.
- CategoryDataset. For charts with numeric/string information on one axis, and string information on another, and pie plots.
- OHLCDataset. For financial quote charts.
- XYZDataset. For bubble charts.
Renderer is object, that performs data drawing. For one dataset type, can be many renderer, for example: XYDataset can be rendered as lines, histogram or area, OHLCDataset can be drawn as bars or candlesticks.
Renderers can be following types:
- XYRenderer. For drawing XY data.
- BarRenderer. For drawing bars: normal, stacked, layered.
- OHLCRenderer. For drawing financial quote data.
- XYZDataset. For drawing XYZ data.
Axis is an object, that performs data scaling and axis rendering.
- NumberAxis. For displaying numeric labels, and scaling numeric data.
- CategoryAxis. For string labels.
- DateAxis. For date/time labels.
- CompDateAxis. Interval axis for date/time labels.
Plot is an object, that connects axes, datasets, visual objects (markers, crosshairs). It contains title, background, etc.
Chart is an object, that contains title, plot.
- Area draws.
Markers are used to mark data values and/or intervals. Markers are connected with dataset. There are following marker types:
- Point marker. Marks single point value.
- Line marker. Uses to mark the specified value as line.
- Range marker. Used to mark the specified range of values.
Area draws are objects, that performs drawing background (plot, chart), bars in bars plots, legend symbols, etc. There two area draw types: fill and gradient.
Legend draws legend symbols and serie names. It has position within plot, font to draw labels, etc. Legend can be vertical or horizontal.
AxisShare is helper object, that makes it possible to create combined axis plots.
Multiplot is a special kind of plot, that contains many subplots. It's used to
In this part of article, i introduced wxFreeChart design. In the next parts i will provide you an example of how to create a simple chart, more detailed explanation for wxFreeChart objects, dataset-renderers configurations for each chart type.
wxFreeChart home page: http://wxcode.sourceforge.net/components/freechart/