@@ -7,8 +7,7 DeclarativeChart::DeclarativeChart(QDeclarativeItem *parent) | |||
|
7 | 7 | m_chart(new QChart(this)) |
|
8 | 8 | { |
|
9 | 9 | setFlag(QGraphicsItem::ItemHasNoContents, false); |
|
10 | m_chart->resize(QSize(height(), width())); | |
|
11 | m_chart->setMargin(25); // TODO: should not be needed? | |
|
10 | // m_chart->setMargin(50); // TODO: should not be needed? | |
|
12 | 11 | } |
|
13 | 12 | |
|
14 | 13 | DeclarativeChart::ChartTheme DeclarativeChart::theme() |
@@ -19,7 +18,8 DeclarativeChart::ChartTheme DeclarativeChart::theme() | |||
|
19 | 18 | |
|
20 | 19 | void DeclarativeChart::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) |
|
21 | 20 | { |
|
22 | m_chart->resize(QSize(newGeometry.width(), newGeometry.height())); | |
|
21 | if (newGeometry.isValid()) | |
|
22 | m_chart->resize(newGeometry.width(), newGeometry.height()); | |
|
23 | 23 | } |
|
24 | 24 | |
|
25 | 25 | #include "moc_declarativechart.cpp" |
@@ -17,16 +17,16 Rectangle { | |||
|
17 | 17 | // labels: ["point1", "point2", "point3", "point4", "point5"] |
|
18 | 18 | // datax: [2, 1.5, 3, 3, 3] |
|
19 | 19 | // } |
|
20 | PieSeries { | |
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
20 | // PieSeries { | |
|
21 | // name: "raspberry pie" | |
|
22 | // seriesLabels: ["point1", "point2", "point3", "point4", "point5"] | |
|
23 | // seriesData: [2, 1.5, 3, 3, 3] | |
|
24 | // } | |
|
25 | // ScatterSeries { | |
|
26 | // name: "scatter1" | |
|
27 | // datax: [2, 1.5, 3, 3, 3] | |
|
28 | // datay: [2, 1.5, 3, 3, 3] | |
|
29 | // } | |
|
30 | 30 |
|
|
31 | 31 | // labels: ["point1", "point2", "point3", "point4", "point5"] |
|
32 | 32 | // datax: [2, 1.5, 3, 3, 3] |
General Comments 0
You need to be logged in to leave comments.
Login now