diff options
author | Mick A <mick.ashton@flare-esports.net> | 2018-05-09 08:36:07 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-09 08:36:07 -0600 |
commit | 9ee3a74633266b7ba4c8323c82a0ed48c3ce8253 (patch) | |
tree | 79784a165ed61a150e027ee0e25277257cfa9c0c /MPChartLib/src/main/java/com | |
parent | 73054bedc36c32bffa77f23e3be711636c91c136 (diff) | |
parent | 89436221db3d83991f9ecd830f871d4ce7da47a4 (diff) | |
download | MPAndroidChart-9ee3a74633266b7ba4c8323c82a0ed48c3ce8253.tar.gz |
Merge pull request #4013 from RobertZagorski/bugfix/#2369-legend-offset-is-not-calculated-twice-for-line-chart
Remove mLabelRotatedHeight counted twice, when calculating legend offset
Diffstat (limited to 'MPChartLib/src/main/java/com')
-rw-r--r-- | MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java index bf4c42e2..1cca83dd 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java @@ -427,18 +427,12 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData< offsets.top += Math.min(mLegend.mNeededHeight, mViewPortHandler.getChartHeight() * mLegend.getMaxSizePercent()) + mLegend.getYOffset(); - - if (getXAxis().isEnabled() && getXAxis().isDrawLabelsEnabled()) - offsets.top += getXAxis().mLabelRotatedHeight; break; case BOTTOM: offsets.bottom += Math.min(mLegend.mNeededHeight, mViewPortHandler.getChartHeight() * mLegend.getMaxSizePercent()) + mLegend.getYOffset(); - - if (getXAxis().isEnabled() && getXAxis().isDrawLabelsEnabled()) - offsets.bottom += getXAxis().mLabelRotatedHeight; break; default: @@ -478,21 +472,21 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData< if (mXAxis.isEnabled() && mXAxis.isDrawLabelsEnabled()) { - float xlabelheight = mXAxis.mLabelRotatedHeight + mXAxis.getYOffset(); + float xLabelHeight = mXAxis.mLabelRotatedHeight + mXAxis.getYOffset(); // offsets for x-labels if (mXAxis.getPosition() == XAxisPosition.BOTTOM) { - offsetBottom += xlabelheight; + offsetBottom += xLabelHeight; } else if (mXAxis.getPosition() == XAxisPosition.TOP) { - offsetTop += xlabelheight; + offsetTop += xLabelHeight; } else if (mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) { - offsetBottom += xlabelheight; - offsetTop += xlabelheight; + offsetBottom += xLabelHeight; + offsetTop += xLabelHeight; } } @@ -1224,7 +1218,7 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData< /** * When enabled, the values will be clipped to contentRect, - * otherwise they can bleed outside the content rect. + * otherwise they can bleed outside the content rect. * * @param enabled */ @@ -1234,7 +1228,7 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData< /** * When enabled, the values will be clipped to contentRect, - * otherwise they can bleed outside the content rect. + * otherwise they can bleed outside the content rect. * * @return */ |