##// END OF EJS Templates
Now using opaque circle to visualize scatter data
Tero Ahola -
r15:0730a77e7f15
parent child
Show More
@@ -107,14 +107,10 void MainWidget::chartTypeChanged(int itemIndex)
107 case 4: {
107 case 4: {
108 QList<QChartDataPoint> data;
108 QList<QChartDataPoint> data;
109 for (int x = 0; x < 1000; ++x) {
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 m_chartWidget->setType(4);
114 m_chartWidget->setType(4);
119 m_chartWidget->setData(data);
115 m_chartWidget->setData(data);
120 break;
116 break;
@@ -25,13 +25,17 void QSeriesPointGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphi
25
25
26 QPen pen = painter->pen();
26 QPen pen = painter->pen();
27 QBrush brush = pen.brush();
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 pen.setBrush(brush);
30 pen.setBrush(brush);
31 pen.setWidth(4);
30 painter->setPen(pen);
32 painter->setPen(pen);
33 painter->drawArc(0, 0, 4, 4, 0, 5760);
31
34
32 QPixmap pixmap;
35 // TODO: how about using a bitmap?
33 pixmap.load("scatter.png");
36 // QPixmap pixmap;
34 painter->drawPixmap(boundingRect().toRect(), pixmap);
37 // pixmap.load("scatter.png");
38 // painter->drawPixmap(boundingRect().toRect(), pixmap);
35
39
36 // painter->drawRect(boundingRect());
40 // painter->drawRect(boundingRect());
37 }
41 }
General Comments 0
You need to be logged in to leave comments. Login now