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