##// END OF EJS Templates
Rename axisLabelsChanged to axisRangeChanged
Rename axisLabelsChanged to axisRangeChanged

File last commit:

r396:b9c9fb13c5b7
r399:91816cf9fc5c
Show More
main.cpp
76 lines | 1.8 KiB | text/x-c | CppLexer
sauimone
Added bar chart example
r78 #include <QApplication>
#include <QMainWindow>
sauimone
updated barchart examples. minor fixes
r276 #include <qchartview.h>
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include <qbarseries.h>
sauimone
proof of concept implementation for barset and barcategory
r169 #include <qbarset.h>
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 #include <qchartaxis.h>
sauimone
replaced qbarcategory with qstringlist
r377 #include <QStringList>
sauimone
updated barchart examples. minor fixes
r276
sauimone
Added bar chart example
r78 QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;
sauimone
Updated barchart documentation
r319 //! [1]
sauimone
replaced qbarcategory with qstringlist
r377 // Define categories
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 QStringList categories;
categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun";
sauimone
Updated barchart documentation
r319 //! [1]
sauimone
proof of concept implementation for barset and barcategory
r169
sauimone
Updated barchart documentation
r319 //! [2]
sauimone
updated documentation and examples for barcharts
r325 // Create some test sets for chat
sauimone
proof of concept implementation for barset and barcategory
r169
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
Added bar chart example
r78
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 *set0 << 1 << 2 << 3 << 4 << 5 << 6;
*set1 << 5 << 0 << 0 << 4 << 0 << 7;
*set2 << 3 << 5 << 8 << 13 << 8 << 5;
*set3 << 5 << 6 << 7 << 3 << 4 << 5;
*set4 << 9 << 7 << 5 << 3 << 1 << 2;
sauimone
updated documentation and examples for barcharts
r325 //! [2]
//! [3]
// Create series and add sets to it
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 QBarSeries* series= new QBarSeries(categories);
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 barchart documentation
r319 //! [3]
sauimone
updated documentation and examples for barcharts
r325
//! [4]
// Enable some features
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 series->setToolTipEnabled();
sauimone
compile fix. Removed captain obvious documentation from barseries
r359 series->setFloatingValuesEnabled();
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);
sauimone
minor documentation fixes for barchart
r396 chartView->setChartTitle("simple barchart");
sauimone
updated barchart examples. minor fixes
r276 chartView->setChartTheme(QChart::ChartThemeIcy);
sauimone
updated documentation and examples for barcharts
r325 //! [5]
sauimone
Added bar chart example
r78
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 //! [6]
chartView->axisX()->setAxisVisible(false);
chartView->axisX()->setGridVisible(false);
chartView->axisX()->setLabelsVisible(false);
//! [6]
sauimone
updated barchart examples. minor fixes
r276 window.setCentralWidget(chartView);
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 window.resize(400, 300);
sauimone
Added bar chart example
r78 window.show();
return a.exec();
}