##// END OF EJS Templates
First version of legend. Simple markers and serie names. Using drilldown as example for now.
First version of legend. Simple markers and serie names. Using drilldown as example for now.

File last commit:

r486:7ab45bf9f776
r529:73dc1554f5c7
Show More
main.cpp
53 lines | 1.1 KiB | text/x-c | CppLexer
Michal Klocek
adds missing files form previous commit
r12 #include <QApplication>
#include <QMainWindow>
Michal Klocek
Adds rubberband for zooming...
r58 #include <qchartview.h>
Michal Klocek
Rename QLineChartSeries to QLineSeries
r349 #include <qlineseries.h>
Michal Klocek
adds missing files form previous commit
r12 #include <qchart.h>
#include <cmath>
Tero Ahola
Renamed to QtCommercialChart
r30 QTCOMMERCIALCHART_USE_NAMESPACE
Michal Klocek
adds missing files form previous commit
r12
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Michal Klocek
Refactor documentation...
r331 //![1]
Michal Klocek
Rename QLineChartSeries to QLineSeries
r349 QLineSeries* series0 = new QLineSeries();
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 QPen blue(Qt::blue);
blue.setWidth(3);
series0->setPen(blue);
Michal Klocek
Refactor documentation...
r331
Michal Klocek
Rename QLineChartSeries to QLineSeries
r349 QLineSeries* series1 = new QLineSeries();
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 QPen red(Qt::red);
red.setWidth(3);
series1->setPen(red);
Michal Klocek
Refactor documentation...
r331 //![1]
//![2]
series0->add(0, 6);
series0->add(2, 4);
series0->add(3, 8);
series0->add(7, 4);
series0->add(10,5);
Michal Klocek
Adds stream operator to qlinechart
r372 *series1 << QPointF(1, 1) << QPointF(3, 3) << QPointF(7, 6) << QPointF(8, 3) << QPointF(10,2);
Michal Klocek
Refactor documentation...
r331 //![2]
//![3]
Michal Klocek
Add linechart example documentation
r370 QMainWindow window;
Michal Klocek
Adds rubberband for zooming...
r58 QChartView* chartView = new QChartView(&window);
Michal Klocek
Refactors qchart , adds line animation...
r131
Michal Klocek
Adds font handling for chart's titile...
r192 chartView->setChartTitle("Basic line chart example");
Michal Klocek
Add linechart example documentation
r370 chartView->setRenderHint(QPainter::Antialiasing);
Michal Klocek
Add zoom support...
r67 chartView->addSeries(series0);
Michal Klocek
Adds rubberband for zooming...
r58 chartView->addSeries(series1);
Michal Klocek
Refactor documentation...
r331 //![3]
Michal Klocek
Add linechart example documentation
r370 //![4]
Michal Klocek
Adds rubberband for zooming...
r58 window.setCentralWidget(chartView);
Michal Klocek
adds missing files form previous commit
r12 window.resize(400, 300);
window.show();
Michal Klocek
Add linechart example documentation
r370 //![4]
Michal Klocek
adds missing files form previous commit
r12
return a.exec();
}