##// END OF EJS Templates
Drilldown example using stacked barchart.
Drilldown example using stacked barchart.

File last commit:

r398:406174ca742b
r449:2d02ec95e04f
Show More
main.cpp
50 lines | 1.3 KiB | text/x-c | CppLexer
Tero Ahola
Added minimalistic scatter example
r123 #include <QtGui/QApplication>
#include <QMainWindow>
#include <qchartglobal.h>
Michal Klocek
Removes QChartWidget...
r136 #include <qchartview.h>
Tero Ahola
Added minimalistic scatter example
r123 #include <qscatterseries.h>
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Tero Ahola
Scatter series documentation; now uses snippets
r300 //! [1]
// Create chart view
Tero Ahola
QDoc to use style sheets...
r260 QChartView *chartView = new QChartView();
Tero Ahola
Added size customization to QScatterSeries
r397 chartView->setRenderHint(QPainter::Antialiasing);
// Add scatter series with linear test data with random "noise"
Tero Ahola
added stream operator to scatter series
r180 QScatterSeries *scatter = new QScatterSeries();
Tero Ahola
Tuning scatter examples and screens
r398 for (qreal i(0.0); i < 20; i += 0.5) {
Tero Ahola
Added size customization to QScatterSeries
r397 qreal x = i + (qreal)(rand() % 100) / 100.0;
qreal y = i + (qreal)(rand() % 100) / 100.0;
(*scatter) << QPointF(x, y);
}
Tero Ahola
QDoc to use style sheets...
r260 // Chart takes ownership
chartView->addSeries(scatter);
Tero Ahola
Refactored chartwidgettest test data impl
r278 //! [1]
Tero Ahola
Added minimalistic scatter example
r123
Tero Ahola
Scatter series documentation; now uses snippets
r300 // And more
Tero Ahola
Added size customization to QScatterSeries
r397 //! [2]
Tero Ahola
Tuning scatter examples and screens
r398 *scatter << QPointF(2.0, 5.5) << QPointF(2.2, 5.4);
Tero Ahola
Added size customization to QScatterSeries
r397 //! [2]
Tero Ahola
Scatter series documentation; now uses snippets
r300
Tero Ahola
Added size customization to QScatterSeries
r397 //! [3]
QBrush brush(QColor(255, 0, 0, 80), Qt::SolidPattern);
Tero Ahola
Fixing review findings in QScatterSeries
r358 scatter->setBrush(brush);
Tero Ahola
Added size customization to QScatterSeries
r397 QPen pen(QColor(0, 255, 0, 60), 3);
Tero Ahola
Fixing review findings in QScatterSeries
r358 scatter->setPen(pen);
scatter->setShape(QScatterSeries::MarkerShapeRectangle);
Tero Ahola
Tuning scatter examples and screens
r398 scatter->setSize(25.0);
Tero Ahola
Added size customization to QScatterSeries
r397 //! [3]
Tero Ahola
Added minimalistic scatter example
r123
// Use the chart widget as the central widget
QMainWindow w;
Tero Ahola
Clicked, remove and clear to QScatterSeries
r394 w.resize(400, 300);
Tero Ahola
QDoc to use style sheets...
r260 w.setCentralWidget(chartView);
Tero Ahola
Clicked, remove and clear to QScatterSeries
r394 w.setWindowFlags(Qt::FramelessWindowHint);
Tero Ahola
Added minimalistic scatter example
r123 w.show();
return a.exec();
}