Most real-time chart examples in the ChartDirector distribution append new data to the right side
of the chart. When the data lines reach the right border, the chart will scroll to the left to leave
space for more data.
In contrast, in this Real-Time Sweep Chart example, when the data lines reach the right border, they
will wrap back and restart from the left side.
This example uses a layout that puts the y-axis labels inside the plot area. This maximize the plot
area width as it is no longer necessary to reserve space outside of the plot area for the labels. In
this example, it allows the chart to cover the entire window horizontally.
The data source in this example is a psuedo random wave generator running in a separate thread, like
that in the Multithreading
*** 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.