Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected void onCreate(Bundle savedInstanceState) {
xAxis.setCenterAxisLabels(true);
xAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return String.valueOf((int) value);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected void onCreate(Bundle savedInstanceState) {

xAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return data.get(Math.min(Math.max((int) value, 0), data.size()-1)).xAxisValue;
}
});
Expand Down Expand Up @@ -166,7 +166,7 @@ public ValueFormatter() {
}

@Override
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
public String getFormattedValue(double value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
return mFormat.format(value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void onCreate(Bundle savedInstanceState) {
xAxis.setGranularity(1f);
xAxis.setValueFormatter(new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return mMonths[(int) value % mMonths.length];
}
});
Expand All @@ -95,7 +95,7 @@ public String getFormattedValue(float value, AxisBase axis) {
data.setData(generateCandleData());
data.setValueTypeface(mTfLight);

xAxis.setAxisMaximum(data.getXMax() + 0.25f);
xAxis.setAxisMaximum(data.getXMax() + 0.25d);

mChart.setData(data);
mChart.invalidate();
Expand Down Expand Up @@ -136,7 +136,7 @@ private BarData generateBarData() {
entries1.add(new BarEntry(0, getRandom(25, 25)));

// stacked
entries2.add(new BarEntry(0, new float[]{getRandom(13, 12), getRandom(13, 12)}));
entries2.add(new BarEntry(0, new double[]{getRandom(13, 12), getRandom(13, 12)}));
}

BarDataSet set1 = new BarDataSet(entries1, "Bar 1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void setData(int count, float range) {
set1.setDrawHorizontalHighlightIndicator(false);
set1.setFillFormatter(new IFillFormatter() {
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
public double getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
return -10;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void setData(int count, float range) {
set1.setDrawCircleHole(false);
set1.setFillFormatter(new IFillFormatter() {
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
public double getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
return mChart.getAxisLeft().getAxisMinimum();
}
});
Expand All @@ -130,7 +130,7 @@ public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProv
set2.setHighLightColor(Color.rgb(244, 117, 117));
set2.setFillFormatter(new IFillFormatter() {
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
public double getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
return mChart.getAxisLeft().getAxisMaximum();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected void onCreate(Bundle savedInstanceState) {
private SimpleDateFormat mFormat = new SimpleDateFormat("dd MMM HH:mm");

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {

long millis = TimeUnit.HOURS.toMillis((long) value);
return mFormat.format(new Date(millis));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected void onCreate(Bundle savedInstanceState) {
private String[] mActivities = new String[]{"Burger", "Steak", "Salad", "Pasta", "Pizza"};

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return mActivities[(int) value % mActivities.length];
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

yVals1.add(new BarEntry(
i,
new float[]{val1, val2, val3},
new double[]{val1, val2, val3},
getResources().getDrawable(R.drawable.star)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected void onCreate(Bundle savedInstanceState) {
private DecimalFormat format = new DecimalFormat("###");

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return format.format(value) + "-" + format.format(value + 10);
}
});
Expand All @@ -98,18 +98,18 @@ public String getFormattedValue(float value, AxisBase axis) {

// IMPORTANT: When using negative values in stacked bars, always make sure the negative values are in the array first
ArrayList<BarEntry> yValues = new ArrayList<BarEntry>();
yValues.add(new BarEntry(5, new float[]{ -10, 10 }));
yValues.add(new BarEntry(15, new float[]{ -12, 13 }));
yValues.add(new BarEntry(25, new float[]{ -15, 15 }));
yValues.add(new BarEntry(35, new float[]{ -17, 17 }));
yValues.add(new BarEntry(45, new float[]{ -19, 20 }));
yValues.add(new BarEntry(45, new float[]{ -19, 20 }, getResources().getDrawable(R.drawable.star)));
yValues.add(new BarEntry(55, new float[]{ -19, 19 }));
yValues.add(new BarEntry(65, new float[]{ -16, 16 }));
yValues.add(new BarEntry(75, new float[]{ -13, 14 }));
yValues.add(new BarEntry(85, new float[]{ -10, 11 }));
yValues.add(new BarEntry(95, new float[]{ -5, 6 }));
yValues.add(new BarEntry(105, new float[]{ -1, 2 }));
yValues.add(new BarEntry(5, new double[]{ -10, 10 }));
yValues.add(new BarEntry(15, new double[]{ -12, 13 }));
yValues.add(new BarEntry(25, new double[]{ -15, 15 }));
yValues.add(new BarEntry(35, new double[]{ -17, 17 }));
yValues.add(new BarEntry(45, new double[]{ -19, 20 }));
yValues.add(new BarEntry(45, new double[]{ -19, 20 }, getResources().getDrawable(R.drawable.star)));
yValues.add(new BarEntry(55, new double[]{ -19, 19 }));
yValues.add(new BarEntry(65, new double[]{ -16, 16 }));
yValues.add(new BarEntry(75, new double[]{ -13, 14 }));
yValues.add(new BarEntry(85, new double[]{ -10, 11 }));
yValues.add(new BarEntry(95, new double[]{ -5, 6 }));
yValues.add(new BarEntry(105, new double[]{ -1, 2 }));

BarDataSet set = new BarDataSet(yValues, "Age Distribution");
set.setDrawIcons(false);
Expand Down Expand Up @@ -244,13 +244,13 @@ public CustomFormatter() {

// data
@Override
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
public String getFormattedValue(double value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
return mFormat.format(Math.abs(value)) + "m";
}

// YAxis
@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return mFormat.format(Math.abs(value)) + "m";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public DayAxisValueFormatter(BarLineChartBase<?> chart) {
}

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {

int days = (int) value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public MyAxisValueFormatter() {
}

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return mFormat.format(value) + " $";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public MyCustomXAxisValueFormatter(ViewPortHandler viewPortHandler) {
}

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {

//Log.i("TRANS", "x: " + viewPortHandler.getTransX() + ", y: " + viewPortHandler.getTransY());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MyFillFormatter(float fillpos) {
}

@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
public double getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
// your logic could be here
return mFillPos;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public MyValueFormatter() {
}

@Override
public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
public String getFormattedValue(double value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
return mFormat.format(value) + " $";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public YearXAxisFormatter() {
}

@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {

float percent = value / axis.mAxisRange;
double percent = value / axis.mAxisRange;
return mMonths[(int) (mMonths.length * percent)];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void setData() {

IAxisValueFormatter formatter = new IAxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
public String getFormattedValue(double value, AxisBase axis) {
return results.get((int) value).getPlayerName();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public void setInverted(boolean inverted) {
this.mInverted = inverted;
}

protected void addBar(float left, float top, float right, float bottom) {
protected void addBar(double left, double top, double right, double bottom) {

buffer[index++] = left;
buffer[index++] = top;
buffer[index++] = right;
buffer[index++] = bottom;
buffer[index++] = (float)left;
buffer[index++] = (float)top;
buffer[index++] = (float)right;
buffer[index++] = (float)bottom;
}

@Override
Expand All @@ -53,15 +53,15 @@ public void feed(IBarDataSet data) {
if(e == null)
continue;

float x = e.getX();
float y = e.getY();
float[] vals = e.getYVals();
double x = e.getX();
double y = e.getY();
double[] vals = e.getYVals();

if (!mContainsStacks || vals == null) {

float left = x - barWidthHalf;
float right = x + barWidthHalf;
float bottom, top;
double left = x - barWidthHalf;
double right = x + barWidthHalf;
double bottom, top;

if (mInverted) {
bottom = y >= 0 ? y : 0;
Expand All @@ -81,14 +81,14 @@ public void feed(IBarDataSet data) {

} else {

float posY = 0f;
double posY = 0d;
float negY = -e.getNegativeSum();
float yStart = 0f;
double yStart = 0d;

// fill the stack
for (int k = 0; k < vals.length; k++) {

float value = vals[k];
double value = vals[k];

if (value == 0.0f && (posY == 0.0f || negY == 0.0f)) {
// Take care of the situation of a 0.0 value, which overlaps a non-zero bar
Expand All @@ -104,9 +104,9 @@ public void feed(IBarDataSet data) {
negY += Math.abs(value);
}

float left = x - barWidthHalf;
float right = x + barWidthHalf;
float bottom, top;
double left = x - barWidthHalf;
double right = x + barWidthHalf;
double bottom, top;

if (mInverted) {
bottom = y >= yStart ? y : yStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public void feed(IBarDataSet data) {
if(e == null)
continue;

float x = e.getX();
float y = e.getY();
float[] vals = e.getYVals();
float x = e.getFloatX();
float y = e.getFloatY();
double[] vals = e.getYVals();

if (!mContainsStacks || vals == null) {

Expand Down Expand Up @@ -57,7 +57,7 @@ public void feed(IBarDataSet data) {
// fill the stack
for (int k = 0; k < vals.length; k++) {

float value = vals[k];
float value = (float)vals[k];

if (value >= 0f) {
y = posY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public void getBarBounds(BarEntry e, RectF outputRect) {
return;
}

float y = e.getY();
float x = e.getX();
float y = e.getFloatY();
float x = e.getFloatX();

float barWidth = mData.getBarWidth();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public void centerViewTo(float xValue, float yValue, AxisDependency axis) {
* @param duration the duration of the animation in milliseconds
*/
@TargetApi(11)
public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis, long duration) {
public void centerViewToAnimated(double xValue, double yValue, AxisDependency axis, long duration) {

if (android.os.Build.VERSION.SDK_INT >= 11) {

Expand All @@ -949,7 +949,7 @@ public void centerViewToAnimated(float xValue, float yValue, AxisDependency axis
float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX();

Runnable job = AnimatedMoveViewJob.getInstance(mViewPortHandler,
xValue - xInView / 2f, yValue + yInView / 2f,
xValue - xInView / 2d, yValue + yInView / 2d,
getTransformer(axis), this, (float) bounds.x, (float) bounds.y, duration);

addViewportJob(job);
Expand Down Expand Up @@ -1053,8 +1053,8 @@ public MPPointF getPosition(Entry e, AxisDependency axis) {
if (e == null)
return null;

mGetPositionBuffer[0] = e.getX();
mGetPositionBuffer[1] = e.getY();
mGetPositionBuffer[0] = e.getFloatX();
mGetPositionBuffer[1] = e.getFloatY();

getTransformer(axis).pointValuesToPixel(mGetPositionBuffer);

Expand Down Expand Up @@ -1563,12 +1563,12 @@ public void setRendererRightYAxis(YAxisRenderer rendererRightYAxis) {
}

@Override
public float getYChartMax() {
public double getYChartMax() {
return Math.max(mAxisLeft.mAxisMaximum, mAxisRight.mAxisMaximum);
}

@Override
public float getYChartMin() {
public double getYChartMin() {
return Math.min(mAxisLeft.mAxisMinimum, mAxisRight.mAxisMinimum);
}

Expand Down
Loading