2

I want to create a "table" (which is build with a recycle view) below my chart. But I want the RecycleView to have the same number of elements of my chart (In this case 7) Is there a way to get the column width of the Bar Chartso I can assign the same width to my Recycle View Cells?

enter image description here

At the end (if it is posible) I want the two scroll to be synced.

Mario Galván
  • 3,964
  • 6
  • 29
  • 39

1 Answers1

2

The bar width in pixels is the difference between the value bar width x position (wp) and the label starting position (xp):

        Transformer transformer = bChart.getTransformer(YAxis.AxisDependency.LEFT);
        float bw = (float) transformer.getPixelForValues(bChart.getBarData().getBarWidth(), 0).x;
        float xp = (float) transformer.getPixelForValues(0, 0).x;
        float barWidthInPixels = bw - xp;
nnyerges
  • 563
  • 4
  • 15