Skip to content

Commit 2eca41f

Browse files
committed
Fixed BubbleChart issue.
1 parent 710d5de commit 2eca41f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

MPChartExample/src/com/xxmassdeveloper/mpchartexample/CombinedChartActivity.java

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ protected void onCreate(Bundle savedInstanceState) {
4747

4848
mChart = (CombinedChart) findViewById(R.id.chart1);
4949
mChart.setDescription("");
50+
mChart.setBackgroundColor(Color.WHITE);
5051
mChart.setDrawGridBackground(false);
5152
mChart.setDrawBarShadow(false);
5253

MPChartLib/src/com/github/mikephil/charting/utils/Transformer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public float[] generateTransformedValuesScatter(List<? extends Entry> entries,
128128
public float[] generateTransformedValuesBubble(List<? extends Entry> entries,
129129
float phaseX, float phaseY, int from, int to) {
130130

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

133133
float[] valuePoints = new float[count];
134134

@@ -137,7 +137,7 @@ public float[] generateTransformedValuesBubble(List<? extends Entry> entries,
137137
Entry e = entries.get(j / 2 + from);
138138

139139
if (e != null) {
140-
valuePoints[j] = (float)(e.getXIndex() - from) * phaseX + from;
140+
valuePoints[j] = (float) (e.getXIndex() - from) * phaseX + from;
141141
valuePoints[j + 1] = e.getVal() * phaseY;
142142
}
143143
}

0 commit comments

Comments
 (0)