##// END OF EJS Templates
Documented couple of missing parameters in QPieSeries
Documented couple of missing parameters in QPieSeries

File last commit:

r338:7289fb2b50fb
r347:7cfd1fcf5481
Show More
main.cpp
69 lines | 1.9 KiB | text/x-c | CppLexer
sauimone
percent bar chart
r101 #include <QApplication>
#include <QMainWindow>
#include <QStandardItemModel>
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include <qpercentbarseries.h>
sauimone
updated barchart examples
r170 #include <qbarcategory.h>
sauimone
updated barchart examples. minor fixes
r276 #include <qchartview.h>
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 #include <qbarset.h>
sauimone
percent bar chart
r101
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;
sauimone
updated documentation and examples for barcharts
r325 //! [1]
// Create category
sauimone
fixed bug in category implementation. model now owns the category and sets
r173 QBarCategory *category = new QBarCategory;
*category << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "June" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec";
sauimone
Updated barchart documentation
r319 //! [1]
sauimone
updated barchart examples
r170
sauimone
updated documentation and examples for barcharts
r325 //! [2]
// Create some test sets for chat
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 QBarSet *set0 = new QBarSet("Bub");
QBarSet *set1 = new QBarSet("Bob");
QBarSet *set2 = new QBarSet("Guybrush");
QBarSet *set3 = new QBarSet("Larry");
QBarSet *set4 = new QBarSet("Zak");
sauimone
percent bar chart
r101
sauimone
fixed bug in category implementation. model now owns the category and sets
r173 *set0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12;
*set1 << 5 << 0 << 0 << 4 << 0 << 7 << 8 << 9 << 9 << 0 << 4 << 2;
*set2 << 3 << 5 << 8 << 13 << 8 << 5 << 3 << 2 << 1 << 1 << 3 << 5;
*set3 << 5 << 6 << 7 << 3 << 4 << 5 << 8 << 9 << 10 << 5 << 2 << 7;
*set4 << 9 << 7 << 5 << 3 << 1 << 2 << 4 << 6 << 8 << 10 << 1 << 6;
sauimone
updated documentation and examples for barcharts
r325 //! [2]
//! [3]
// Create series and add sets to it
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 QPercentBarSeries* series = new QPercentBarSeries(category);
sauimone
fixed bug in category implementation. model now owns the category and sets
r173
sauimone
updated barchart examples. minor fixes
r276 series->addBarSet(set0);
series->addBarSet(set1);
series->addBarSet(set2);
series->addBarSet(set3);
series->addBarSet(set4);
sauimone
updated documentation and examples for barcharts
r325 //! [3]
sauimone
proof of concept implementation for barset and barcategory
r169
sauimone
updated documentation and examples for barcharts
r325 //! [4]
// Enable features
sauimone
Updated barchart documentation
r319 series->enableToolTip();
series->enableFloatingValues();
sauimone
updated documentation and examples for barcharts
r325 //! [4]
//! [5]
// Create view for chart and add series to it. Apply theme.
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296
sauimone
updated barchart examples. minor fixes
r276 QChartView* chartView = new QChartView(&window);
chartView->addSeries(series);
chartView->setChartTitle("simple percent barchart");
chartView->setChartTheme(QChart::ChartThemeIcy);
sauimone
updated documentation and examples for barcharts
r325 //! [5]
sauimone
percent bar chart
r101
sauimone
updated barchart examples. minor fixes
r276 window.setCentralWidget(chartView);
sauimone
percent bar chart
r101 window.resize(400, 300);
window.show();
return a.exec();
}