Mpandroidchart: Bar Chart with Various Bar Widths

Created on 1 Sep 2017  路  2Comments  路  Source: PhilJay/MPAndroidChart

Hi, I'm trying to create a bar chart that has time on the x axis, and I want the bars to be created based on a certain time interval which can and will vary. For example, one bar will span the width of 0 to 8 seconds, the next from 8 to 10, and the next from 10 to 30. Is this possible using this library? Everything I have tried or seen online uses bars with the same width. Let me know, thanks!

Most helpful comment

In case anyone else wanted to do this, I was able to get it done by using a LineChart. For each bar you want create a new DataSet having two entries, each with a different x value but both with the same y value. Then fill underneath to create the appearance of a bar. Works great.

All 2 comments

In case anyone else wanted to do this, I was able to get it done by using a LineChart. For each bar you want create a new DataSet having two entries, each with a different x value but both with the same y value. Then fill underneath to create the appearance of a bar. Works great.

Hello @tommyjackson , what about click listeners for those datasets, are they works right?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thanhcly920 picture thanhcly920  路  3Comments

JungYongWook picture JungYongWook  路  3Comments

rohitkumarbhagat picture rohitkumarbhagat  路  3Comments

manucheri picture manucheri  路  3Comments

SutharRohit picture SutharRohit  路  3Comments