@@ -107,14 +107,10 void MainWidget::chartTypeChanged(int itemIndex) | |||
|
107 | 107 | case 4: { |
|
108 | 108 | QList<QChartDataPoint> data; |
|
109 | 109 | for (int x = 0; x < 1000; ++x) { |
|
110 | data.append(QChartDataPoint() << x -200 << 2 * (uint(sin(3.14159/50*x)*80) % 100)); | |
|
110 | data.append(QChartDataPoint() << x - 200 << 2 * (uint(sin(3.14159/50*x)*80) % 100) + (rand() % 100 * 0.2)); | |
|
111 | data.append(QChartDataPoint() << x - 200 << 2 * (uint(sin(3.14159/50*x)*80) % 100) + (rand() % 100 * 0.2)); | |
|
112 | data.append(QChartDataPoint() << x - 200 << 2 * (uint(sin(3.14159/50*x)*80) % 100) + (rand() % 100 * 0.2)); | |
|
111 | 113 | } |
|
112 | // data.append(QChartDataPoint() << 0 << 0); | |
|
113 | // data.append(QChartDataPoint() << 2 << 2); | |
|
114 | // data.append(QChartDataPoint() << 4 << 5); | |
|
115 | // data.append(QChartDataPoint() << 5 << 9); | |
|
116 | // data.append(QChartDataPoint() << 20 << 20); | |
|
117 | // QList<int> data; | |
|
118 | 114 | m_chartWidget->setType(4); |
|
119 | 115 | m_chartWidget->setData(data); |
|
120 | 116 | break; |
@@ -25,13 +25,17 void QSeriesPointGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphi | |||
|
25 | 25 | |
|
26 | 26 | QPen pen = painter->pen(); |
|
27 | 27 | QBrush brush = pen.brush(); |
|
28 | brush.setColor(Qt::darkRed); | |
|
28 | // TODO: The opacity should be user definable... | |
|
29 | brush.setColor(QColor(255, 82, 0, 50)); | |
|
29 | 30 | pen.setBrush(brush); |
|
31 | pen.setWidth(4); | |
|
30 | 32 | painter->setPen(pen); |
|
33 | painter->drawArc(0, 0, 4, 4, 0, 5760); | |
|
31 | 34 | |
|
32 | QPixmap pixmap; | |
|
33 | pixmap.load("scatter.png"); | |
|
34 | painter->drawPixmap(boundingRect().toRect(), pixmap); | |
|
35 | // TODO: how about using a bitmap? | |
|
36 | // QPixmap pixmap; | |
|
37 | // pixmap.load("scatter.png"); | |
|
38 | // painter->drawPixmap(boundingRect().toRect(), pixmap); | |
|
35 | 39 | |
|
36 | 40 | // painter->drawRect(boundingRect()); |
|
37 | 41 | } |
General Comments 0
You need to be logged in to leave comments.
Login now