diff --git a/examples/zoomlinechart/chartwidget.cpp b/examples/zoomlinechart/chartwidget.cpp index 6631965..50d0937 100644 --- a/examples/zoomlinechart/chartwidget.cpp +++ b/examples/zoomlinechart/chartwidget.cpp @@ -11,8 +11,7 @@ void ChartWidget::mousePressEvent(QMouseEvent *event) { if(event->button()!=Qt::LeftButton) return; - int margin = this->margin(); - + int margin = 25; QRect rect(margin,margin,width()-2*margin,height()-2*margin); m_origin = event->pos(); diff --git a/qmlplugin/declarativechart.cpp b/qmlplugin/declarativechart.cpp index fb377ab..eef3ac1 100644 --- a/qmlplugin/declarativechart.cpp +++ b/qmlplugin/declarativechart.cpp @@ -16,19 +16,9 @@ DeclarativeChart::ChartTheme DeclarativeChart::theme() void DeclarativeChart::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { - qDebug() << "geometryChanged " << this << " old geometry: " << oldGeometry; if (newGeometry.isValid()) { if (newGeometry.width() > 0 && newGeometry.height() > 0) { - // TODO: setting margin should not be needed to make axis visible? - const int margin = 30; - if (m_chart->margin() == 0 - && newGeometry.width() > (margin * 2) - && newGeometry.height() > (margin * 2)) { - m_chart->setMargin(margin); - m_chart->resize(newGeometry.width(), newGeometry.height()); - } else { - m_chart->resize(newGeometry.width(), newGeometry.height()); - } + m_chart->resize(newGeometry.width(), newGeometry.height()); } } }