diff --git a/plugins/chartshape/Axis.h b/plugins/chartshape/Axis.h --- a/plugins/chartshape/Axis.h +++ b/plugins/chartshape/Axis.h @@ -86,6 +86,7 @@ QFont font() const; qreal fontSize() const; bool isVisible() const; + bool showRuler() const; void setTitleText(const QString &text); void setShowLabels(bool show); @@ -125,6 +126,7 @@ void setFont(const QFont &font); void setFontSize(qreal size); void setVisible(bool visible); + void setShowRuler(bool show); KoOdfNumberStyles::NumericStyleFormat *numericStyleFormat() const; void SetNumericStyleFormat(KoOdfNumberStyles::NumericStyleFormat *numericStyleFormat) const; diff --git a/plugins/chartshape/Axis.cpp b/plugins/chartshape/Axis.cpp --- a/plugins/chartshape/Axis.cpp +++ b/plugins/chartshape/Axis.cpp @@ -69,6 +69,7 @@ #include #include #include +#include // KoChart #include "PlotArea.h" @@ -259,6 +260,9 @@ KChart::RulerAttributes attr = kdAxis->rulerAttributes(); attr.setShowRulerLine(true); +#if KCHART_VERSION >= 0x020689 + attr.setRulerLinePen(QPen()); +#endif kdAxis->setRulerAttributes(attr); } @@ -1010,6 +1014,18 @@ detachDataSet(dataSet, true); } +bool Axis::showRuler() const +{ + return d->kdAxis->rulerAttributes().showRulerLine(); +} + +void Axis::setShowRuler(bool show) +{ + KChart::RulerAttributes attr = d->kdAxis->rulerAttributes(); + attr.setShowRulerLine(!attr.showRulerLine()); + d->kdAxis->setRulerAttributes(attr); +} + qreal Axis::majorInterval() const { return d->majorInterval; diff --git a/plugins/chartshape/PlotArea.cpp b/plugins/chartshape/PlotArea.cpp --- a/plugins/chartshape/PlotArea.cpp +++ b/plugins/chartshape/PlotArea.cpp @@ -50,7 +50,7 @@ #include #include #include - +#include #include #include #include @@ -1313,6 +1313,9 @@ // is not not cut off. painter.setClipping(false); if (kdchartRect.width() > 10 && kdchartRect.height() > 10) { +#if KCHART_VERSION < 0x020689 + painter.setPen(QPen()); // ruler line needs a pen to be shown +#endif d->kdChart->paint(&painter, kdchartRect); } //painter.restore();