##// END OF EJS Templates
Adds titles to all linechart examples
Adds titles to all linechart examples

File last commit:

r87:efb0f73ff869
r88:f5359701ad12
Show More
main.cpp
45 lines | 1.0 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
Refactor current draft to fit int current design specs...
r21 #include <qxychartseries.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
#define PI 3.14159265358979
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow window;
Michal Klocek
Refactor current draft to fit int current design specs...
r21 QXYChartSeries* series0 = QXYChartSeries::create();
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 current draft to fit int current design specs...
r21 QXYChartSeries* series1 = QXYChartSeries::create();
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
adds missing files form previous commit
r12
int numPoints = 100;
Michal Klocek
Add zoom support...
r67 for (int x = 0; x <= numPoints; ++x) {
series0->add(x, abs(sin(PI/50*x)*100));
series1->add(x, abs(cos(PI/50*x)*100));
}
Michal Klocek
adds missing files form previous commit
r12
Michal Klocek
Adds rubberband for zooming...
r58 QChartView* chartView = new QChartView(&window);
Michal Klocek
Refactora axis and line chart to use graphics items insted of painter.
r85 chartView->setRenderHint(QPainter::Antialiasing);
Michal Klocek
Adds title support
r87 chartView->setTitle("Example: sin & cos functions");
Michal Klocek
Add zoom support...
r67 chartView->addSeries(series0);
Michal Klocek
Adds rubberband for zooming...
r58 chartView->addSeries(series1);
Michal Klocek
adds missing files form previous commit
r12
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();
return a.exec();
}