Skip to content

Commit

Permalink
Minor fixes on BubbleChart.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed May 4, 2015
1 parent fb2439d commit 710d5de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ protected void drawDataSet(Canvas c, BubbleDataSet dataSet) {
int maxx = Math.min(dataSet.getEntryPosition(entryTo) + 1, entries.size());

sizeBuffer[0] = 0f;
sizeBuffer[1] = mChart.getYChartMin();
sizeBuffer[2] = 1f;
sizeBuffer[3] = mChart.getYChartMax();

trans.pointValuesToPixel(sizeBuffer);

// calcualte the full width of 1 step on the x-axis
final float maxBubbleWidth = Math.abs(sizeBuffer[2] - sizeBuffer[0]);
final float maxBubbleHeight = Math.abs(sizeBuffer[1] - sizeBuffer[3]);
final float maxBubbleHeight = Math.abs(mViewPortHandler.contentBottom() - mViewPortHandler.contentTop());
final float referenceSize = Math.min(maxBubbleHeight, maxBubbleWidth);

for (int j = minx; j < maxx; j++) {
Expand Down Expand Up @@ -216,15 +214,13 @@ public void drawHighlighted(Canvas c, Highlight[] indices) {
Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

sizeBuffer[0] = 0f;
sizeBuffer[1] = mChart.getYChartMin();
sizeBuffer[2] = 1f;
sizeBuffer[3] = mChart.getYChartMax();

trans.pointValuesToPixel(sizeBuffer);

// calcualte the full width of 1 step on the x-axis
final float maxBubbleWidth = Math.abs(sizeBuffer[2] - sizeBuffer[0]);
final float maxBubbleHeight = Math.abs(sizeBuffer[1] - sizeBuffer[3]);
final float maxBubbleHeight = Math.abs(mViewPortHandler.contentBottom() - mViewPortHandler.contentTop());
final float referenceSize = Math.min(maxBubbleHeight, maxBubbleWidth);

pointBuffer[0] = (float) (entry.getXIndex() - minx) * phaseX + (float) minx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public float[] generateTransformedValuesScatter(List<? extends Entry> entries,
public float[] generateTransformedValuesBubble(List<? extends Entry> entries,
float phaseX, float phaseY, int from, int to) {

final int count = from - to;
final int count = (int)Math.ceil((to - from) * phaseX) * 2;

float[] valuePoints = new float[count];

Expand Down

0 comments on commit 710d5de

Please sign in to comment.