Mpandroidchart: BubbleChart -Bubbles size

Created on 9 May 2017  路  4Comments  路  Source: PhilJay/MPAndroidChart

Hi I麓m working with BubbleChart on MPAndroidChart .My X values are pretty big and so my bubbles size are very small,in order to see the bubbles is necessary to zoom a lot on the chart.I set big size for the bubbles but they keep small. Thats my code.

BubbleChart bubbleChart=(BubbleChart) findViewById(R.id.bubbleChart);

    ArrayList<BubbleEntry> entries = new ArrayList<>();


    entries.add(new BubbleEntry(323,1f,10f));
    entries.add(new BubbleEntry(981,5f, 10f));
    entries.add(new BubbleEntry(1300,3f ,10f));


    XAxis xAxis = bubbleChart.getXAxis();
    xAxis.setAxisMinimum(0);
    xAxis.setAxisMaximum(1440);

    YAxis yAxis = bubbleChart.getAxisLeft();

    yAxis.setAxisMinimum(0);
    yAxis.setAxisMaximum(8);

    YAxis yAxis2=bubbleChart.getAxisRight();
    yAxis2.setAxisMinimum(0);
    yAxis2.setAxisMaximum(8);


    BubbleDataSet bubbleDataSet = new BubbleDataSet(entries, "");
    bubbleDataSet.setColor(Color.RED,180);


    BubbleData data= new BubbleData(bubbleDataSet);
    bubbleChart.setData(data);

Screenshot:

screenshot_20170509-124125

Most helpful comment

bubbleDataSet .setNormalizeSizeEnabled(false);
this code solves your problem

All 4 comments

I also need help with this one. I'm in the same situation. I have a high number on my x-axis and my bubbles are nearly impossible to see...

bubbleDataSet .setNormalizeSizeEnabled(false);
this code solves your problem

any solution found for this ? @07asier

You will need to override BubbleChartRenderer.drawDataSet or at least getShapeSize to change this behavior. Or perhaps you can extend BubbleDataSet and provide a method to set mMaxSize. See my comments on issue #3304. They should explain what is going on.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreyfel picture andreyfel  路  3Comments

Nima9Faraji picture Nima9Faraji  路  3Comments

OnlyInAmerica picture OnlyInAmerica  路  3Comments

Giammaofwar picture Giammaofwar  路  3Comments

botondbutuza picture botondbutuza  路  3Comments