Skip to content

Commit

Permalink
Merge #1947
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Jul 2, 2016
1 parent 40c5c87 commit 43fa1e6
Show file tree
Hide file tree
Showing 27 changed files with 191 additions and 333 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {

mChart = (LineChart) findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setLogEnabled(true);

// no description text
mChart.setDescription("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public Highlight getHighlightByTouchPoint(float x, float y) {
*/
public RectF getBarBounds(BarEntry e) {


RectF bounds = new RectF();
getBarBounds(e, bounds);

Expand Down Expand Up @@ -143,7 +142,6 @@ public void getBarBounds(BarEntry e, RectF outputRect){
bounds.set(left, top, right, bottom);

getTransformer(set.getAxisDependency()).rectValueToPixel(outputRect);

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,9 @@ public IBarLineScatterCandleBubbleDataSet getDataSetByTouchPoint(float x, float
return null;
}

/** buffer for storing lowest visible x point */
protected PointD posForGetLowestVisibleX = PointD.getInstance(0,0);

/**
* Returns the lowest x-index (value on the x-axis) that is still visible on
* the chart.
Expand All @@ -1295,7 +1297,9 @@ public float getLowestVisibleX() {
return result;
}

/** buffer for storing highest visible x point */
protected PointD posForGetHighestVisibleX = PointD.getInstance(0,0);

/**
* Returns the highest x-index (value on the x-axis) that is still visible
* on the chart.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
Expand Down Expand Up @@ -1429,50 +1428,6 @@ public void setDrawMarkerViews(boolean enabled) {
mDrawMarkerViews = enabled;
}

/**
* Get all Entry objects at the given index across all DataSets.
* INFORMATION: This method does calculations at runtime. Do not over-use in
* performance critical situations.
*
* @param xIndex
* @return
*/
public List<Entry> getEntriesAtIndex(int xIndex) {

List<Entry> vals = new ArrayList<Entry>();

for (int i = 0; i < mData.getDataSetCount(); i++) {

IDataSet set = mData.getDataSetByIndex(i);

Entry e = set.getEntryForXPos(xIndex);

if (e != null) {
vals.add(e);
}
}

return vals;
}

public void getEntriesAtIndex(int xIndex, List<Entry> entriesOutput){

List<Entry> vals = entriesOutput;
vals.clear();

for (int i = 0; i < mData.getDataSetCount(); i++) {

IDataSet set = mData.getDataSetByIndex(i);

Entry e = set.getEntryForXPos(xIndex);

if (e != null) {
vals.add(e);
}
}

}

/**
* Returns the ChartData object that has been set for the chart.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.mikephil.charting.charts;

import android.content.Context;
import android.graphics.PointF;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
Expand All @@ -18,7 +17,6 @@
import com.github.mikephil.charting.renderer.YAxisRendererHorizontalBarChart;
import com.github.mikephil.charting.utils.HorizontalViewPortHandler;
import com.github.mikephil.charting.utils.MPPointF;
import com.github.mikephil.charting.utils.PointD;
import com.github.mikephil.charting.utils.TransformerHorizontalBarChart;
import com.github.mikephil.charting.utils.Utils;

Expand Down Expand Up @@ -209,7 +207,6 @@ public Highlight getHighlightByTouchPoint(float x, float y) {
return getHighlighter().getHighlight(y, x); // switch x and y
}

protected PointD posForGetLowestVisibleX = PointD.getInstance(0,0);
@Override
public float getLowestVisibleX() {
getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),
Expand All @@ -218,7 +215,6 @@ public float getLowestVisibleX() {
return result;
}

protected PointD posForGetHighestVisibleX = PointD.getInstance(0,0);
@Override
public float getHighestVisibleX() {
getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(mViewPortHandler.contentLeft(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ public BarDataSet(List<BarEntry> yVals, String label) {
calcEntryCountIncludingStacks(yVals);
}

protected List<BarEntry> barEntriesForCopy = new ArrayList<>();
@Override
public DataSet<BarEntry> copy() {

List<BarEntry> yVals = barEntriesForCopy;
List<BarEntry> yVals = new ArrayList<BarEntry>();
yVals.clear();

for (int i = 0; i < mValues.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,12 @@ public void setColors(int[] colors, Context c) {
if(mColors == null){
mColors = new ArrayList<>();
}
List<Integer> clrs = mColors;
clrs.clear();

mColors.clear();

for (int color : colors) {
clrs.add(c.getResources().getColor(color));
mColors.add(c.getResources().getColor(color));
}

mColors = clrs;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet;

import java.util.ArrayList;
import java.util.List;

public class BubbleData extends BarLineScatterCandleBubbleData<IBubbleDataSet> {
Expand All @@ -28,11 +27,8 @@ public BubbleData(List<IBubbleDataSet> dataSets) {
* @param width
*/
public void setHighlightCircleWidth(float width) {
IBubbleDataSet set;
final int setCount = mDataSets.size();
for(int i = 0 ; i < setCount ; i++){
set = mDataSets.get(i);
set.setHighlightCircleWidth(width);
for(int i = 0 ; i < mDataSets.size() ; i++){
mDataSets.get(i).setHighlightCircleWidth(width);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ public void calcMinMax() {
}
}

protected ArrayList<BubbleEntry> bubbleEntriesForCopy = new ArrayList<>();
@Override
public DataSet<BubbleEntry> copy() {

List<BubbleEntry> yVals = bubbleEntriesForCopy;
yVals.clear();
List<BubbleEntry> yVals = new ArrayList<BubbleEntry>();

for (int i = 0; i < mValues.size(); i++) {
yVals.add(mValues.get(i).copy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ public CandleDataSet(List<CandleEntry> yVals, String label) {
super(yVals, label);
}

protected ArrayList<CandleEntry> candleEntriesForCopy = new ArrayList<>();
@Override
public DataSet<CandleEntry> copy() {

List<CandleEntry> yVals = candleEntriesForCopy;
List<CandleEntry> yVals = new ArrayList<CandleEntry>();
yVals.clear();

for (int i = 0; i < mValues.size(); i++) {
yVals.add(((CandleEntry) mValues.get(i)).copy());
yVals.add(mValues.get(i).copy());
}

CandleDataSet copied = new CandleDataSet(yVals, getLabel());
Expand Down
Loading

0 comments on commit 43fa1e6

Please sign in to comment.