diff --git a/lib/jkqtplotter/graphs/jkqtpevaluatedfunction.cpp b/lib/jkqtplotter/graphs/jkqtpevaluatedfunction.cpp index d8a75f10df..a8175101c6 100644 --- a/lib/jkqtplotter/graphs/jkqtpevaluatedfunction.cpp +++ b/lib/jkqtplotter/graphs/jkqtpevaluatedfunction.cpp @@ -33,13 +33,12 @@ JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase(JKQTBasePlotter* parent): JKQTPEvaluatedFunctionWithErrorsGraphBase(parent), - drawLine(true), - fillCurve(false), drawErrorPolygons(false), drawErrorLines(false) { initLineStyle(parent, parentPlotStyle); initFillStyle(parent, parentPlotStyle); + setFillCurve(false); errorColor=getLineColor().lighter(); errorFillColor=getLineColor().lighter(); @@ -71,16 +70,6 @@ JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::~JKQTPEvaluatedFunctionWithErr } -void JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::setDrawLine(bool __value) -{ - this->drawLine = __value; -} - -bool JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::getDrawLine() const -{ - return this->drawLine; -} - void JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect) { painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();}); QPen p=getLinePen(painter, parent); @@ -90,10 +79,10 @@ void JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::drawKeyMarker(JKQTPEnhanc QBrush b=getFillBrush(painter, parent); const double y=rect.top()+rect.height()/2.0; painter.setPen(np); - if (drawLine) painter.setPen(p); + if (getDrawLine()) painter.setPen(p); painter.setBrush(b); - if (fillCurve) painter.drawRect(rect); - if (!fillCurve && drawLine) painter.drawLine(QLineF(rect.left(), y, rect.right(), y)); + if (getFillCurve()) painter.drawRect(rect); + if (!getFillCurve() && getDrawLine()) painter.drawLine(QLineF(rect.left(), y, rect.right(), y)); } @@ -262,7 +251,7 @@ void JKQTPEvaluatedFunctionWithErrorsGraphDrawingBase::drawXGraph(JKQTPEnhancedP y=qBound(yami, y, yama); - if (fillCurve) { + if (getFillCurve()) { if (!first) filledPolygon<m_drawLine = __value; -} - -bool JKQTPSpecialLineHorizontalGraph::getDrawLine() const -{ - return this->m_drawLine; -} - void JKQTPSpecialLineHorizontalGraph::setDrawSymbols(bool __value) { m_drawSymbols=__value; @@ -99,15 +88,6 @@ bool JKQTPSpecialLineHorizontalGraph::getDrawSymbols() const return m_drawSymbols; } -void JKQTPSpecialLineHorizontalGraph::setFillCurve(bool __value) -{ - this->m_fillCurve = __value; -} - -bool JKQTPSpecialLineHorizontalGraph::getFillCurve() const -{ - return this->m_fillCurve; -} void JKQTPSpecialLineHorizontalGraph::setSpecialLineType(const JKQTPSpecialLineType &__value) { @@ -155,164 +135,159 @@ void JKQTPSpecialLineHorizontalGraph::draw(JKQTPEnhancedPainter& painter) { QPen np(Qt::NoPen); QBrush b=getFillBrush(painter, parent); - int imax=static_cast(qMin(datastore->getRows(static_cast(xColumn)), datastore->getRows(static_cast(yColumn)))); + int imax=0; int imin=0; - if (imax ps; - double xold=-1; - double yold=-1; -// double xstart=-1; -// double ystart=-1; - //double x0=transformX(0); - //if (parent->getXAxis()->isLogAxis()) x0=transformX(parent->getXAxis()->getMin()); - double y0=transformY(m_baseline); - if (parent->getYAxis()->isLogAxis()) { - y0=transformY(parent->getYAxis()->getMin()); - if (m_baseline>0 && m_baseline>parent->getYAxis()->getMin()) y0=transformY(m_baseline); - else y0=transformY(parent->getYAxis()->getMin()); - } - bool subsequentItem=false; - intSortData(); - for (int iii=imin; iiiget(static_cast(xColumn),static_cast(i)); - double yv=datastore->get(static_cast(yColumn),static_cast(i)); - //std::cout<<"(xv, yv) = ( "< ps; - if (m_specialLineType==JKQTPStepCenter) { - // x/y - // |--------* - // | - // *--------| - // xold/yold - const double d=(x-xold); - pf.lineTo(xold+d/2.0, yold); - pf.lineTo(xold+d/2.0, y); + double xold=-1; + double yold=-1; + // double xstart=-1; + // double ystart=-1; + //double x0=transformX(0); + //if (parent->getXAxis()->isLogAxis()) x0=transformX(parent->getXAxis()->getMin()); + double y0=transformY(m_baseline); + if (parent->getYAxis()->isLogAxis()) { + y0=transformY(parent->getYAxis()->getMin()); + if (m_baseline>0 && m_baseline>parent->getYAxis()->getMin()) y0=transformY(m_baseline); + else y0=transformY(parent->getYAxis()->getMin()); + } + bool subsequentItem=false; + intSortData(); + for (int iii=imin; iiiget(static_cast(xColumn),static_cast(i)); + const double yv=datastore->get(static_cast(yColumn),static_cast(i)); + //std::cout<<"(xv, yv) = ( "<(qMin(datastore->getRows(static_cast(xColumn)), datastore->getRows(static_cast(yColumn)))); + int imax=0; int imin=0; - if (imax ps; - double xold=-1; - double yold=-1; - double x0=transformX(m_baseline); - if (parent->getXAxis()->isLogAxis()) { - if (m_baseline>0 && m_baseline>parent->getXAxis()->getMin()) x0=transformX(m_baseline); - else x0=transformX(parent->getXAxis()->getMin()); - } - bool first=false; - intSortData(); - for (int iii=imin; iiiget(static_cast(xColumn),static_cast(i)); - double yv=datastore->get(static_cast(yColumn),static_cast(i)); - //std::cout<<"(xv, yv) = ( "< ps; - if (m_specialLineType==JKQTPStepCenter) { - double d=(y-yold); - pf.lineTo(xold, yold+d/2.0); - pf.lineTo(x, yold+d/2.0); + double xold=-1; + double yold=-1; + double x0=transformX(m_baseline); + if (parent->getXAxis()->isLogAxis()) { + if (m_baseline>0 && m_baseline>parent->getXAxis()->getMin()) x0=transformX(m_baseline); + else x0=transformX(parent->getXAxis()->getMin()); + } + bool first=false; + intSortData(); + for (int iii=imin; iiiget(static_cast(xColumn),static_cast(i)); + const double yv=datastore->get(static_cast(yColumn),static_cast(i)); + //std::cout<<"(xv, yv) = ( "<