diff --git a/src/animations/boxplotanimation.cpp b/src/animations/boxplotanimation.cpp index 210f078..a115f63 100644 --- a/src/animations/boxplotanimation.cpp +++ b/src/animations/boxplotanimation.cpp @@ -42,7 +42,11 @@ void BoxPlotAnimation::addBox(BoxWhiskers *box) animation = new BoxWhiskersAnimation(box, this); m_animations.insert(box, animation); BoxWhiskersData start; + start.m_lowerExtreme = box->m_data.m_median; + start.m_lowerQuartile = box->m_data.m_median; start.m_median = box->m_data.m_median; + start.m_upperQuartile = box->m_data.m_median; + start.m_upperExtreme = box->m_data.m_median; animation->setup(start, box->m_data); } else { animation->stop(); @@ -54,7 +58,7 @@ ChartAnimation *BoxPlotAnimation::boxAnimation(BoxWhiskers *box) { BoxWhiskersAnimation *animation = m_animations.value(box); if (animation) - animation->m_moveMedianLine = false; + animation->m_changeAnimation = false; return animation; } @@ -62,7 +66,7 @@ ChartAnimation *BoxPlotAnimation::boxAnimation(BoxWhiskers *box) ChartAnimation *BoxPlotAnimation::boxChangeAnimation(BoxWhiskers *box) { BoxWhiskersAnimation *animation = m_animations.value(box); - animation->m_moveMedianLine = true; + animation->m_changeAnimation = true; animation->setEndData(box->m_data); return animation; diff --git a/src/animations/boxwhiskersanimation.cpp b/src/animations/boxwhiskersanimation.cpp index 2ce9352..92cab83 100644 --- a/src/animations/boxwhiskersanimation.cpp +++ b/src/animations/boxwhiskersanimation.cpp @@ -50,7 +50,7 @@ QVariant BoxWhiskersAnimation::interpolated(const QVariant &from, const QVariant BoxWhiskersData endData = qvariant_cast(to); BoxWhiskersData result; - if (m_moveMedianLine) { + if (m_changeAnimation) { result.m_lowerExtreme = startData.m_lowerExtreme + progress * (endData.m_lowerExtreme - startData.m_lowerExtreme); result.m_lowerQuartile = startData.m_lowerQuartile + progress * (endData.m_lowerQuartile - startData.m_lowerQuartile); result.m_median = startData.m_median + progress * (endData.m_median - startData.m_median); diff --git a/src/animations/boxwhiskersanimation_p.h b/src/animations/boxwhiskersanimation_p.h index 1d7ddfa..c1e9f16 100644 --- a/src/animations/boxwhiskersanimation_p.h +++ b/src/animations/boxwhiskersanimation_p.h @@ -60,7 +60,7 @@ public: // from QVariantAnimation protected: friend class BoxPlotAnimation; BoxWhiskers *m_box; - bool m_moveMedianLine; + bool m_changeAnimation; BoxPlotAnimation *m_boxPlotAnimation; };