Reputation: 137
I am using QtCreator
and have installed the QCustomPlot
library in my project. I want to be able to draw both a line graph and bar chart for the same data. The data is held in an array which is constantly updated by another function - hence, how do you create a realtime line graph and bar chart on the same axes?
This is the statements that set the x and y coordinates of points.
QVector<double> x(140), y(140);
for (int q=5; i<145; i+5)
{
x[q] = q;
y[q] = GraphReadings[((q/5)*2)+2];
}
Upvotes: 0
Views: 1723
Reputation: 148
There's an example on the QCustomPlot tutorials site for this: http://www.qcustomplot.com/index.php/demos/styleddemo
This example shows a line graph and bar graph on the same axes, however doesn't share exactly the same data but the general idea of how to do it is there.
Upvotes: 1