##// END OF EJS Templates
BarChart brush and labels fix
Marek Rosa -
r2311:4de64fb010d7
parent child
Show More
@@ -123,6 +123,7 void AbstractBarChartItem::handleLayoutChanged()
123 return; // rect size zero.
123 return; // rect size zero.
124 QVector<QRectF> layout = calculateLayout();
124 QVector<QRectF> layout = calculateLayout();
125 applyLayout(layout);
125 applyLayout(layout);
126 handleUpdatedBars();
126 }
127 }
127
128
128 void AbstractBarChartItem::handleLabelsVisibleChanged(bool visible)
129 void AbstractBarChartItem::handleLabelsVisibleChanged(bool visible)
@@ -141,8 +142,6 void AbstractBarChartItem::handleDataStructureChanged()
141 m_labels.clear();
142 m_labels.clear();
142 m_layout.clear();
143 m_layout.clear();
143
144
144 bool labelsVisible = m_series->isLabelsVisible();
145
146 // Create new graphic items for bars
145 // Create new graphic items for bars
147 for (int c = 0; c < m_series->d_func()->categoryCount(); c++) {
146 for (int c = 0; c < m_series->d_func()->categoryCount(); c++) {
148 for (int s = 0; s < m_series->count(); s++) {
147 for (int s = 0; s < m_series->count(); s++) {
@@ -158,14 +157,13 void AbstractBarChartItem::handleDataStructureChanged()
158 m_layout.append(QRectF(0, 0, 0, 0));
157 m_layout.append(QRectF(0, 0, 0, 0));
159
158
160 // Labels
159 // Labels
161 QGraphicsSimpleTextItem *label = new QGraphicsSimpleTextItem(this);
160 m_labels.append(new QGraphicsSimpleTextItem(this));
162 label->setVisible(labelsVisible);
163 m_labels.append(label);
164 }
161 }
165 }
162 }
166
163
167 if(themeManager()) themeManager()->updateSeries(m_series);
164 if(themeManager()) themeManager()->updateSeries(m_series);
168 handleLayoutChanged();
165 handleLayoutChanged();
166 handleVisibleChanged();
169 }
167 }
170
168
171 void AbstractBarChartItem::handleVisibleChanged()
169 void AbstractBarChartItem::handleVisibleChanged()
General Comments 0
You need to be logged in to leave comments. Login now