Skip to content

Commit

Permalink
Fix issue PhilJay#521 & address issue PhilJay#520.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Apr 6, 2015
1 parent 0c45981 commit 338afb3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

tvX.setText("" + (mSeekBarX.getProgress() * 3 + 1));
tvX.setText("" + (mSeekBarX.getProgress() * 3));
tvY.setText("" + (mSeekBarY.getProgress()));

ArrayList<String> xVals = new ArrayList<String>();
for (int i = 0; i < mSeekBarX.getProgress() + 1; i++) {
for (int i = 0; i < mSeekBarX.getProgress(); i++) {
xVals.add((i + 1990) + "");
}

Expand Down
17 changes: 15 additions & 2 deletions MPChartLib/src/com/github/mikephil/charting/charts/Chart.java
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ public void setRenderer(DataRenderer renderer) {
if (renderer != null)
mRenderer = renderer;
}

@Override
public PointF getCenterOfView() {
return getCenter();
Expand Down Expand Up @@ -1357,15 +1357,28 @@ public void clearAllJobs() {
mJobs.clear();
}

/**
* Returns all jobs that are scheduled to be executed after
* onSizeChanged(...).
*
* @return
*/
public ArrayList<Runnable> getJobs() {
return mJobs;
}

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
if (mLogEnabled)
Log.i(LOG_TAG, "OnSizeChanged()");

if (w > 0 && h > 0 && w < 10000 && h < 10000) {
// create a new bitmap with the new dimensions

if (mDrawBitmap != null)
mDrawBitmap.recycle();

mDrawBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444);
// mDrawCanvas = new Canvas(mDrawBitmap);
mViewPortHandler.setChartDimens(w, h);

if (mLogEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ protected void drawCircles(Canvas c) {

float halfsize = dataSet.getCircleSize() / 2f;

for (int j = 0, count = (int)Math.ceil((maxx - minx) * phaseX + minx) * 2; j < count; j += 2) {
for (int j = 0, count = (int) Math.ceil((maxx - minx) * phaseX + minx) * 2; j < count; j += 2) {

float x = buffer.buffer[j];
float y = buffer.buffer[j + 1];
Expand All @@ -508,7 +508,7 @@ protected void drawCircles(Canvas c) {
if (!mViewPortHandler.isInBoundsLeft(x) || !mViewPortHandler.isInBoundsY(y))
continue;

int circleColor = dataSet.getCircleColor(j / 2);
int circleColor = dataSet.getCircleColor(j / 2 + minx);

mRenderPaint.setColor(circleColor);

Expand Down

0 comments on commit 338afb3

Please sign in to comment.