##// END OF EJS Templates
Removes obsolete functions...
Removes obsolete functions * removes old interface from chartitem

File last commit:

r136:adef258de74b
r141:c4fe96eff980
Show More
main.cpp
34 lines | 862 B | text/x-c | CppLexer
Jani Honkonen
Added piechart example
r128 #include <QtGui/QApplication>
#include <QMainWindow>
#include <cmath>
#include <qchartglobal.h>
Michal Klocek
Removes QChartWidget...
r136 #include <qchartview.h>
Jani Honkonen
Added piechart example
r128 #include <qpieseries.h>
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// Create widget and scatter series
Michal Klocek
Removes QChartWidget...
r136 QChartView *chartWidget = new QChartView();
Jani Honkonen
Added piechart example
r128 QPieSeries *series = qobject_cast<QPieSeries *>(chartWidget->createSeries(QChartSeries::SeriesTypePie));
Q_ASSERT(series);
// Add test data to the series
QList<qreal> x;
for (qreal i(0.0); i < 20; i += 0.5) {
// Linear data with random component
x.append(i + ((qreal)(rand() % 100)) / 100 );
}
series->setData(x);
// Use the chart widget as the central widget
QMainWindow w;
w.resize(640, 480);
w.setCentralWidget(chartWidget);
w.show();
return a.exec();
}