wxChartDir  2.0.1
wxChartDir

What is wxChartDir?

wxChartDir provides components for the integration and use of the commercial C++ library ChartDirector, a universal chart component developed by Advanced Software Engineering Ltd, in wxWidgets based applications.

At first glance it may seem to contradict the open source philosophy to support a commercial library, when open source libraries for charting (like wxFreeChart or wxCharts) are available. However, ChartDirector is an extremely versatile, stable and affordable charting library.

ChartDirector supports many different chart types like pie, donut, bar, line, spline, step line, trend line, curve-fitting, inter-line filling, area, band, scatter, bubble, floating box, box-whisker, waterfall, contour, heat map, surface, vector, finance, gantt, radar, polar, rose, pyramid, cone, funnel and more. Charts can be created as vector graphics in PDF and SVG and as raster graphics in PNG, JPG, GIF and BMP. Please visit the ChartDirector gallery to get an impression of the capabilities of this library.

wxChartDir includes the following charting controls:

wxChartViewer

a wxWidgets control that inherits from wxPanel and ViewPortManager.

A viewport can be imagined as a rectangular window of an underlying rectangular surface. For example, a chart that has 10 years of data can be imagined as a very long chart. If one only displays one of the years, it can be said that the viewport covers only 10% of the underlying chart.

With the viewport concept, scrolling can be handled as moving the viewport, while zooming in and out can be handled as changing the viewport size.

wxViewPortControl

a wxWidgets control that inherits from wxPanel and from ViewPortControlBase.

A viewport control is a user interface element to let the user visualize and manipulate the viewport managed by the ViewPortManager.

In typical usage, the viewport control displays an "overall chart" that shows the full data range, and connects to the ViewPortManager (wxChartViewer). It can then include a rectangle on the overall chart to represent the viewport in the ViewPortManager. The region outside the rectangle can be dimmed out to highlight the viewport region. If the viewport is updated (such as if the user uses the mouse wheel to zoom in the chart), the rectangle will also update automatically.

Additionally, wxChartDir contains wxWidgets based versions of all sample applications coming with ChartDirector and of the extra samples available from the ChartDirector website. ChartDirector itself contains versions for QT and MFC.

Note
While the source code of the components wxChartViewer and wxViewPortControl as well as that of the wxWidgets based standard samples is licensed under the wxWindows license (resp LGPL - 3.0 + WITH WxWindows - exception - 3.1), the extra samples contain code that is restricted by the following terms:

You may use and modify the code in this file in your application, provided the code and its modifications are used only in conjunction with ChartDirector. Usage of this software is subject to the terms and conditions of the ChartDirector license.

A copy of the ChartDirector license is included in the wxChartDir distribution.

Documentation

The API documentation for the ChartDirector library itself is part of the ChartDirector documentation.

All methods of the classes wxChartViewer and wxViewPortControl are documented here. However, the documentation of the base classes ViewPortManager resp ViewPortControlBase can be found in the ChartDirector documentation. The documentation for the base class wxPanel is part of the wxWidgets documentation.

Please note that the implementation of wxChartViewer closely follows that of QChartViewer, the official implementation chart viewer for QT. Therefore the QChartViewer documentation can be used as a reference in large parts, too.

Version history

2.0.1 - March 2023
Workaround for issue #16
2.0.0 - July 2021
Update to ChartDirector 7.0
Enhance drawing of selection box
Add support for DPI awareness
Remove support for wxWidgets versions 2.x
1.0.0 - July 2018

First public release

Author
Ulrich Telle (ulrich DOT telle AT gmx DOT de)

Acknowledgments

Kudos to Peter Kwan from Advanced Software Engineering Ltd for his excellent support during the development of this component.