This example demonstrates a real-time chart with a viewport control. It is based on the
Real-Time Chart with Zooming and Scrolling sample code in the ChartDirector
distribution with the following changes:
- The horizontal scrollbar is replaced with a Viewport Control that also updates in real-time.
- The data source is changed to running in a separate thread like that in the
Multithreading Real-Time Chart sample code.
- The y-axis labels are moved inside the plot area. This allows a wider plot area as it is
no longer necessary to reserve space outside of the plot area for the labels.
Download
*** Note *** : If you are new to ChartDirector, it is
recommended you download ChartDirector from the
download page to try it.
It includes complete ChartDirector documentation as well as plenty of sample code designed as tutorials. The
following assumes you already have some basic understanding of ChartDirector.
The sample code in this page is included as part of the "Real-Time Chart Extra Sample Code Pack".
Real-Time Chart Extra Sample Code Pack for C++ (MFC, Qt)
- Remember to unblock the ZIP
file before extracting the contents out
- Includes Visual Studio solution (for C++/MFC), Qt project file (for C++/Qt), and both 32-bit and
64-bit ChartDirector Windows DLL.
- If you are using another operating system edition of ChartDirector, simply copy the sample code folder
inside the qtdemo folder to the qtdemo folder of your ChartDirector distribution, and you can compile and
run the Qt sample code.
Reference
The followings are links to the documentation of the original Real-Time Chart with Zooming and Scrolling sample code.