You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArrayList<BubbleEntry> entries2 = new ArrayList<>();
for (int i = 0; i < newData.size(); i++) {
entries2.add(new BubbleEntry((float) i, Float.valueOf(newData.get(i).toString()), 10f));
}
BubbleDataSet set2 = new BubbleDataSet(entries2, "Data");
set2.setColors(Color.rgb(140, 234, 255), Color.rgb(255, 208, 140));
set2.setValueTextSize(10f);
set2.setValueTextColor(R.color.dark_gray);
set2.setHighlightCircleWidth(1.5f);
set2.setDrawValues(true);
set2.setAxisDependency(YAxis.AxisDependency.LEFT);
bubbleData.addDataSet(set2);
data.setData(bubbleData);`
I defined size as 10 but the bubbles are larger and 10.0 is getting displayed in all bubbles whereas it should have shown the value from arraylist.
The graph is getting displayed properly.
The text was updated successfully, but these errors were encountered:
Your expectation that the bubble size will be 10 does not make any sense. 10 what? If you look at your chart, each bubble is 1 x-unit wide and about 20 left-axis-units high (~90 - 110) and 35 right-axis-units high (~185 to 220). The bubbles must be scaled to make them round rather than oval, so the radius of the circle drawn on the chart can not be the size field of the BubbleEntry (although they are directly proportional).
The size of the largest drawn circle in a data set is computed to be one x-unit wide. (This maximum size is reduced if that would make the largest circle bigger than the y range.) That is exactly what you got, and is what you will always get. (Although you might play around with the idea of putting a large BubbleEntry outside the chart area to limit the size of the visible circles. I am not sure how that might work.)
The mapping from BubbleEntry size to drawn radius is not intuitive. It depends on the size of the largest entry in the data set (see MarkerView not working #2), the scaling of the axes, and whether BubbleDataSet mNormalizeSize is true or false. If true, the entry size is assumed to be an area; if false it is assumed to be a radius. If you had different size bubbles, the drawn circles would scale accordingly.
The value that is displayed in the circle is provided by ValueFormatter.getBubbleLabel(entry). It defaults to getFormattedValue(bubbleEntry.getSize()). If you want to display something different, you need to override this method or provide a different formatter.
`BubbleData bubbleData = new BubbleData();
I defined size as 10 but the bubbles are larger and 10.0 is getting displayed in all bubbles whereas it should have shown the value from arraylist.
The graph is getting displayed properly.
The text was updated successfully, but these errors were encountered: