@Test public void measureInnerChartLeft_LabelsNone_Result() { when(mStyleMock.hasYAxis()).thenReturn(true); when(mStyleMock.getAxisThickness()).thenReturn(6.f); when(mStyleMock.getYLabelsPositioning()).thenReturn(AxisRenderer.LabelPosition.OUTSIDE); when(mStyleMock.getLabelsPaint()).thenReturn(mMockPaint); when(mStyleMock.getAxisLabelsSpacing()).thenReturn(6); when(mMockPaint.measureText("0")).thenReturn(6.f); when(mMockPaint.measureText("1")).thenReturn(12.f); mYRndr.init(mData, mStyleMock); assertEquals(30.f, mYRndr.measureInnerChartLeft(6), RESULT_THRESHOLD); }
public float measureInnerChartLeft(int left) { float result = left; if (style.hasYAxis()) result += style.getAxisThickness(); if (style.getYLabelsPositioning() == LabelPosition.OUTSIDE) { float aux; float maxLabelLength = 0; for (String label : labels) if ((aux = style.getLabelsPaint().measureText(label)) > maxLabelLength) maxLabelLength = aux; result += maxLabelLength + style.getAxisLabelsSpacing(); } return result; }
YRenderer extends AxisRenderer { public float measureInnerChartLeft(int left) { float result = left; if (style.hasYAxis()) result += style.getAxisThickness(); if (style.getYLabelsPositioning() == LabelPosition.OUTSIDE) { float aux; float maxLabelLength = 0; for (String label : labels) if ((aux = style.getLabelsPaint().measureText(label)) > maxLabelLength) maxLabelLength = aux; result += maxLabelLength + style.getAxisLabelsSpacing(); } return result; } }
YRenderer extends AxisRenderer { public float measureInnerChartLeft(int left) { float result = left; if (style.hasYAxis()) result += style.getAxisThickness(); if (style.getYLabelsPositioning() == LabelPosition.OUTSIDE) { float aux; float maxLabelLength = 0; for (String label : labels) if ((aux = style.getLabelsPaint().measureText(label)) > maxLabelLength) maxLabelLength = aux; result += maxLabelLength + style.getAxisLabelsSpacing(); } return result; } YRenderer(); }
YRenderer extends AxisRenderer { public float measureInnerChartLeft(int left) { float result = left; if (style.hasYAxis()) result += style.getAxisThickness(); if (style.getYLabelsPositioning() == LabelPosition.OUTSIDE) { float aux; float maxLabelLength = 0; for (String label : labels) if ((aux = style.getLabelsPaint().measureText(label)) > maxLabelLength) maxLabelLength = aux; result += maxLabelLength + style.getAxisLabelsSpacing(); } return result; } YRenderer(); @Override void dispose(); @Override void measure(int left, int top, int right, int bottom); @Override void draw(Canvas canvas); @Override float parsePos(int index, double value); float measureInnerChartLeft(int left); float measureInnerChartBottom(int bottom); }
YRenderer extends AxisRenderer { public float measureInnerChartLeft(int left) { float result = left; if (style.hasYAxis()) result += style.getAxisThickness(); if (style.getYLabelsPositioning() == LabelPosition.OUTSIDE) { float aux; float maxLabelLength = 0; for (String label : labels) if ((aux = style.getLabelsPaint().measureText(label)) > maxLabelLength) maxLabelLength = aux; result += maxLabelLength + style.getAxisLabelsSpacing(); } return result; } YRenderer(); @Override void dispose(); @Override void measure(int left, int top, int right, int bottom); @Override void draw(Canvas canvas); @Override float parsePos(int index, double value); float measureInnerChartLeft(int left); float measureInnerChartBottom(int bottom);  }