##// END OF EJS Templates
removed barchartseriesbase. functionality is now in model
removed barchartseriesbase. functionality is now in model

File last commit:

r172:aba5dff73719
r172:aba5dff73719
Show More
main.cpp
49 lines | 1.4 KiB | text/x-c | CppLexer
sauimone
Added bar chart example
r78 #include <QApplication>
#include <QMainWindow>
#include <QStandardItemModel>
#include <barchartseries.h>
sauimone
proof of concept implementation for barset and barcategory
r169 #include <qbarcategory.h>
#include <qbarset.h>
sauimone
Added bar chart example
r78 #include "chartwidget.h"
QTCOMMERCIALCHART_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;
sauimone
proof of concept implementation for barset and barcategory
r169 QBarCategory category;
sauimone
Barset and barcategory implememtation. Updated test application
r171 category << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "June" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec";
sauimone
proof of concept implementation for barset and barcategory
r169
BarChartSeries* series0 = new BarChartSeries(category);
QBarSet barSet0;
QBarSet barSet1;
QBarSet barSet2;
QBarSet barSet3;
QBarSet barSet4;
sauimone
Added bar chart example
r78
// Create some test data to chart
sauimone
removed barchartseriesbase. functionality is now in model
r172 barSet0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12;
barSet1 << 5 << 0 << 0 << 4 << 0 << 7 << 8 << 9 << 9 << 0 << 4 << 2;
barSet2 << 3 << 5 << 8 << 13 << 8 << 5 << 3 << 2 << 1 << 1 << 3 << 5;
barSet3 << 5 << 6 << 7 << 3 << 4 << 5 << 8 << 9 << 10 << 5 << 2 << 7;
barSet4 << 9 << 7 << 5 << 3 << 1 << 2 << 4 << 6 << 8 << 10 << 1 << 6;
sauimone
proof of concept implementation for barset and barcategory
r169
series0->addBarSet(barSet0);
series0->addBarSet(barSet1);
series0->addBarSet(barSet2);
series0->addBarSet(barSet3);
series0->addBarSet(barSet4);
sauimone
Added bar chart example
r78
ChartWidget* chartWidget = new ChartWidget(&window);
chartWidget->addSeries(series0);
window.setCentralWidget(chartWidget);
window.resize(400, 300);
window.show();
return a.exec();
}