PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.53k stars 9.01k forks source link

BarChart height issue #4795

Open hamjabhatti10 opened 4 years ago

hamjabhatti10 commented 4 years ago

I want to adjust height of bar graph according to highest bar value. if i give height to barGraph wrap_content it shows very small bars like this

Screenshot_1580196041

And if i give fix height it draws graph with extra spaces like

Screenshot_1580196190

i want to remove this extra height

InkedScreenshot_1580196190_LI

And i want my graph like this

abccs

kungpaogao commented 4 years ago

Have you tried playing around with the y-axis maximums? For example:

chart.axisLeft.axisMaximum = chart.yChartMax + 1f
chart.axisRight.axisMaximum = chart.yChartMax + 1f

...or something to this effect.

hamjabhatti10 commented 4 years ago

not worked

kungpaogao commented 4 years ago

Do you have any code samples that you can show?

rulogarcillan commented 4 years ago

Im use 'com.github.PhilJay:MPAndroidChart:v3.1.0'

I have something similar in this bar chart in groups, when I only have 1 element, the bars are not drawn proportionally and are drawn below the Y axis

Screenshot_20200210-092703__01

kungpaogao commented 4 years ago

Have you tried setting axisMinimum for axisLeft and/or axisRight to 0?