##// END OF EJS Templates
added stream operator to scatter series
added stream operator to scatter series

File last commit:

r180:6a67b4477dab
r180:6a67b4477dab
Show More
main.cpp
33 lines | 840 B | text/x-c | CppLexer
#include <QtGui/QApplication>
#include <QMainWindow>
#include <cmath>
#include <qchartglobal.h>
#include <qchartview.h>
#include <qscatterseries.h>
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// Create widget and scatter series
QChartView *chartWidget = new QChartView();
QScatterSeries *scatter = new QScatterSeries();
// Add test data to the series
for (qreal i(0.0); i < 20; i += 0.5)
(*scatter) << QPointF(i + (qreal)(rand() % 100) / 100.0,
i + (qreal)(rand() % 100) / 100.0);
// Add series to the chart widget
chartWidget->addSeries(scatter);
// Use the chart widget as the central widget
QMainWindow w;
w.resize(640, 480);
w.setCentralWidget(chartWidget);
w.show();
return a.exec();
}