Android Stacked Bars Chart

前端 未结 1 941
你的背包
你的背包 2021-01-18 04:58

I\'m using the MPAndroidChart library, trying to customize the Stacked Bars. The objective is to display the differences between 2 currencies. So suppose this example for Ja

相关标签:
1条回答
  • 2021-01-18 05:27

    Check out the guide on how to create stacked-bar-charts, as well as the example.

    Create an entry in the stacked-bar-chart in the following way:

    BarEntry entry = new BarEntry(xValue, new float[] { 8f, 12f });
    

    This will create an entry with a total height of 20, consisting of two different values (8 and 12). The "xValue" is the position this bar will show up on the x-axis.

    You can use as many entries for the stack (float array) as you want. If you intend to do only single entries (no stacks), do not use the BarEntry constructor that takes a float array, use the one that only takes a single value.

    0 讨论(0)
提交回复
热议问题