Import cleanup
This commit is contained in:
parent
e2cbafa049
commit
16738ef480
11 changed files with 30 additions and 85 deletions
|
@ -118,7 +118,7 @@ public class BarChart extends BarLineChartBase<BarData> implements BarDataProvid
|
|||
* @param e
|
||||
* @return
|
||||
*/
|
||||
public void getBarBounds(BarEntry e, RectF outputRect){
|
||||
public void getBarBounds(BarEntry e, RectF outputRect) {
|
||||
|
||||
RectF bounds = outputRect;
|
||||
|
||||
|
|
|
@ -511,25 +511,6 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<
|
|||
prepareValuePxMatrix();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected float[] getMarkerPosition(Highlight high) {
|
||||
// return new float[] { high.getXPx(), high.getYPx() };
|
||||
//
|
||||
// int dataSetIndex = highlight.getDataSetIndex();
|
||||
// float xPos = e.getX();
|
||||
// float yPos = e.getY() * mAnimator.getPhaseY();
|
||||
//
|
||||
// // position of the marker depends on selected value index and value
|
||||
// float[] pts = new float[]{
|
||||
// xPos, yPos
|
||||
// };
|
||||
//
|
||||
// getTransformer(mData.getDataSetByIndex(dataSetIndex).getAxisDependency())
|
||||
// .pointValuesToPixel(pts);
|
||||
//
|
||||
// return pts;
|
||||
// }
|
||||
|
||||
/**
|
||||
* draws the grid background
|
||||
*/
|
||||
|
@ -1044,13 +1025,12 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<
|
|||
if (e == null)
|
||||
return null;
|
||||
|
||||
float[] vals = mGetPositionBuffer;
|
||||
vals[0] = e.getX();
|
||||
vals[1] = e.getY();
|
||||
mGetPositionBuffer[0] = e.getX();
|
||||
mGetPositionBuffer[1] = e.getY();
|
||||
|
||||
getTransformer(axis).pointValuesToPixel(vals);
|
||||
getTransformer(axis).pointValuesToPixel(mGetPositionBuffer);
|
||||
|
||||
return MPPointF.getInstance(vals[0], vals[1]);
|
||||
return MPPointF.getInstance(mGetPositionBuffer[0], mGetPositionBuffer[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1255,22 +1235,6 @@ public abstract class BarLineChartBase<T extends BarLineScatterCandleBubbleData<
|
|||
return getTransformer(axis).getPixelsForValues(x, y);
|
||||
}
|
||||
|
||||
MPPointD pointForGetYValueByTouchPoint = MPPointD.getInstance(0, 0);
|
||||
|
||||
/**
|
||||
* Returns y value at the given touch position (must not necessarily be
|
||||
* a value contained in one of the datasets)
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @return
|
||||
*/
|
||||
public float getYValueByTouchPoint(float x, float y, AxisDependency axis) {
|
||||
getValuesByTouchPoint(x, y, axis, pointForGetYValueByTouchPoint);
|
||||
float result = (float) pointForGetYValueByTouchPoint.y;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the Entry object displayed at the touched position of the chart
|
||||
*
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.util.AttributeSet;
|
|||
|
||||
import com.github.mikephil.charting.data.BubbleData;
|
||||
import com.github.mikephil.charting.interfaces.dataprovider.BubbleDataProvider;
|
||||
import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet;
|
||||
import com.github.mikephil.charting.renderer.BubbleChartRenderer;
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.github.mikephil.charting.renderer.CandleStickChartRenderer;
|
|||
|
||||
/**
|
||||
* Financial chart type that draws candle-sticks (OHCL chart).
|
||||
*
|
||||
*
|
||||
* @author Philipp Jahoda
|
||||
*/
|
||||
public class CandleStickChart extends BarLineChartBase<CandleData> implements CandleDataProvider {
|
||||
|
@ -32,7 +32,6 @@ public class CandleStickChart extends BarLineChartBase<CandleData> implements Ca
|
|||
super.init();
|
||||
|
||||
mRenderer = new CandleStickChartRenderer(this, mAnimator, mViewPortHandler);
|
||||
mXAxis.mAxisMinimum = -0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -308,8 +308,8 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent
|
|||
IDataSet set;
|
||||
final List sets = mData.getDataSets();
|
||||
final int count = sets.size();
|
||||
for(int i = 0 ; i < count ; i++){
|
||||
set = (IDataSet)sets.get(i);
|
||||
for (int i = 0; i < count; i++) {
|
||||
set = (IDataSet) sets.get(i);
|
||||
if (set.needsFormatter() || set.getValueFormatter() == mDefaultFormatter)
|
||||
set.setValueFormatter(mDefaultFormatter);
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent
|
|||
protected Highlight[] mIndicesToHighlight;
|
||||
|
||||
/**
|
||||
* The maximum distance in screen pixels away from an entry causing it to highlight.
|
||||
* The maximum distance in dp away from an entry causing it to highlight.
|
||||
*/
|
||||
protected float mMaxHighlightDistance = 0f;
|
||||
|
||||
|
@ -1100,9 +1100,9 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent
|
|||
* @param y - ycoordinate
|
||||
*/
|
||||
public void setDescriptionPosition(float x, float y) {
|
||||
if(mDescriptionPosition == null){
|
||||
mDescriptionPosition = MPPointF.getInstance(x,y);
|
||||
}else {
|
||||
if (mDescriptionPosition == null) {
|
||||
mDescriptionPosition = MPPointF.getInstance(x, y);
|
||||
} else {
|
||||
mDescriptionPosition.x = x;
|
||||
mDescriptionPosition.y = y;
|
||||
}
|
||||
|
@ -1478,12 +1478,12 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent
|
|||
* @param highlighter
|
||||
*/
|
||||
public void setHighlighter(ChartHighlighter highlighter) {
|
||||
|
||||
mHighlighter = highlighter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a recyclable MPPointF instance.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -144,7 +144,7 @@ public class HorizontalBarChart extends BarChart {
|
|||
RectF bounds = outputRect;
|
||||
IBarDataSet set = mData.getDataSetForEntry(e);
|
||||
|
||||
if (set == null){
|
||||
if (set == null) {
|
||||
outputRect.set(Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE);
|
||||
return;
|
||||
}
|
||||
|
@ -166,6 +166,7 @@ public class HorizontalBarChart extends BarChart {
|
|||
}
|
||||
|
||||
protected float[] mGetPositionBuffer = new float[2];
|
||||
|
||||
/**
|
||||
* Returns a recyclable MPPointF instance.
|
||||
*
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.github.mikephil.charting.renderer.LineChartRenderer;
|
|||
|
||||
/**
|
||||
* Chart that draws lines, surfaces, circles, ...
|
||||
*
|
||||
*
|
||||
* @author Philipp Jahoda
|
||||
*/
|
||||
public class LineChart extends BarLineChartBase<LineData> implements LineDataProvider {
|
||||
|
@ -33,7 +33,7 @@ public class LineChart extends BarLineChartBase<LineData> implements LineDataPro
|
|||
|
||||
mRenderer = new LineChartRenderer(this, mAnimator, mViewPortHandler);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LineData getLineData() {
|
||||
return mData;
|
||||
|
@ -42,7 +42,7 @@ public class LineChart extends BarLineChartBase<LineData> implements LineDataPro
|
|||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
// releases the bitmap in the renderer to avoid oom error
|
||||
if(mRenderer != null && mRenderer instanceof LineChartRenderer) {
|
||||
if (mRenderer != null && mRenderer instanceof LineChartRenderer) {
|
||||
((LineChartRenderer) mRenderer).releaseBitmap();
|
||||
}
|
||||
super.onDetachedFromWindow();
|
||||
|
|
|
@ -4,7 +4,6 @@ package com.github.mikephil.charting.charts;
|
|||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.AttributeSet;
|
||||
|
@ -210,17 +209,17 @@ public class PieChart extends PieRadarChartBase<PieData> {
|
|||
|
||||
int entryCount = mData.getEntryCount();
|
||||
|
||||
if(mDrawAngles.length != entryCount) {
|
||||
if (mDrawAngles.length != entryCount) {
|
||||
mDrawAngles = new float[entryCount];
|
||||
}else{
|
||||
for(int i = 0 ; i < entryCount ; i++){
|
||||
} else {
|
||||
for (int i = 0; i < entryCount; i++) {
|
||||
mDrawAngles[i] = 0;
|
||||
}
|
||||
}
|
||||
if(mAbsoluteAngles.length != entryCount) {
|
||||
if (mAbsoluteAngles.length != entryCount) {
|
||||
mAbsoluteAngles = new float[entryCount];
|
||||
}else{
|
||||
for(int i = 0 ; i < entryCount ; i++){
|
||||
} else {
|
||||
for (int i = 0; i < entryCount; i++) {
|
||||
mAbsoluteAngles[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.animation.ValueAnimator;
|
|||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
@ -17,7 +16,6 @@ import com.github.mikephil.charting.components.Legend;
|
|||
import com.github.mikephil.charting.components.XAxis;
|
||||
import com.github.mikephil.charting.data.ChartData;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
|
||||
import com.github.mikephil.charting.listener.PieRadarChartTouchListener;
|
||||
import com.github.mikephil.charting.utils.MPPointF;
|
||||
|
@ -297,12 +295,12 @@ public abstract class PieRadarChartBase<T extends ChartData<? extends IDataSet<?
|
|||
*/
|
||||
public MPPointF getPosition(MPPointF center, float dist, float angle) {
|
||||
|
||||
MPPointF p = MPPointF.getInstance(0,0);
|
||||
MPPointF p = MPPointF.getInstance(0, 0);
|
||||
getPosition(center, dist, angle, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
public void getPosition(MPPointF center, float dist, float angle, MPPointF outputPoint){
|
||||
public void getPosition(MPPointF center, float dist, float angle, MPPointF outputPoint) {
|
||||
outputPoint.x = (float) (center.x + dist * Math.cos(Math.toRadians(angle)));
|
||||
outputPoint.y = (float) (center.y + dist * Math.sin(Math.toRadians(angle)));
|
||||
}
|
||||
|
|
|
@ -4,15 +4,12 @@ package com.github.mikephil.charting.charts;
|
|||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.github.mikephil.charting.components.YAxis;
|
||||
import com.github.mikephil.charting.components.YAxis.AxisDependency;
|
||||
import com.github.mikephil.charting.data.Entry;
|
||||
import com.github.mikephil.charting.data.RadarData;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
import com.github.mikephil.charting.highlight.RadarHighlighter;
|
||||
import com.github.mikephil.charting.renderer.RadarChartRenderer;
|
||||
import com.github.mikephil.charting.renderer.XAxisRendererRadarChart;
|
||||
|
@ -106,22 +103,6 @@ public class RadarChart extends PieRadarChartBase<RadarData> {
|
|||
mXAxis.calculate(0, mData.getMaxEntryCountSet().getEntryCount());
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected float[] getMarkerPosition(Highlight highlight) {
|
||||
// return null;
|
||||
//
|
||||
//// float angle = getSliceAngle() * e.getX() * mAnimator.getPhaseX() + getRotationAngle();
|
||||
//// float val = e.getY() * getFactor() * mAnimator.getPhaseY();
|
||||
//// PointF c = getCenterOffsets();
|
||||
////
|
||||
//// PointF p = new PointF((float) (c.x + val * Math.cos(Math.toRadians(angle))),
|
||||
//// (float) (c.y + val * Math.sin(Math.toRadians(angle))));
|
||||
////
|
||||
//// return new float[]{
|
||||
//// p.x, p.y
|
||||
//// };
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void notifyDataSetChanged() {
|
||||
if (mData == null)
|
||||
|
|
|
@ -42,6 +42,10 @@ public class ScatterChart extends BarLineChartBase<ScatterData> implements Scatt
|
|||
return mData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Predefined ScatterShapes that allow the specification of a shape a ScatterDataSet should be drawn with.
|
||||
* If a ScatterShape is specified for a ScatterDataSet, the required renderer is set.
|
||||
*/
|
||||
public enum ScatterShape {
|
||||
|
||||
SQUARE("SQUARE"), CIRCLE("CIRCLE"), TRIANGLE("TRIANGLE"), CROSS("CROSS"), X("X"), CHEVRON_UP("CHEVRON_UP"),
|
||||
|
|
Loading…
Add table
Reference in a new issue