MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

added titles to the axis

Open xpete opened this issue 7 years ago • 14 comments

I'am using this myself on a LineChart and it's working well. MPAndroidChart is the best chart library for Android but it's useless for me without axis titles and I think it's the most requested feature.

Related feature requests: https://github.com/PhilJay/MPAndroidChart/issues/2034 https://github.com/PhilJay/MPAndroidChart/issues/1869 https://github.com/PhilJay/MPAndroidChart/issues/716 https://github.com/PhilJay/MPAndroidChart/issues/828 https://github.com/PhilJay/MPAndroidChart/issues/1324 https://github.com/PhilJay/MPAndroidChart/issues/1440 https://github.com/PhilJay/MPAndroidChart/issues/513

Screenshot

This is an update of this PR: https://github.com/PhilJay/MPAndroidChart/pull/2625

xpete avatar Sep 02 '17 21:09 xpete

@andrebstv @leslieLinn @hermamitr please check this. I fixed the right YAxis.

xpete avatar Sep 02 '17 23:09 xpete

@boomsya I have a legend and title on the buttom in the screen shot and they are not in the same place. Are you doing anything that could create the bug?

xpete avatar Sep 02 '17 23:09 xpete

The link to the screenshot seems to be dead. I would really want to see this merged, but there are quite a few PRs around here that just haven't ever been replied to... It's a shame 🙁

MaximeKjaer avatar Dec 17 '17 20:12 MaximeKjaer

is it now in the library? Actually I still cannot call the methods

axoaxel avatar May 05 '18 17:05 axoaxel

Currently I see no need to do this in the library itself, due to how simple of a feature it is. If you want axis titles, there is no reason you can't manually put two text views on the sides of the chart view. This is like asking android to add the ability to add a feature that adds captions to ImageViews. They would never add that because you can already do it with TextViews.

This is no different. Won't fix :/

almic avatar May 06 '18 02:05 almic

It's not possible to do this with a TextView because it's not possible to put a TextView between the chart and the legend. If it was possible I would have done it. Before using this library I tried all Android charting libraries I've found and none of them had everything I need but from what I remember all of the others had axis title. I figured It would be easier to fix this library than the others. It's also the most requested feature in this issue tracker. If I was going to do a charting library It would be one of the first things I would. It's just a basic feature of any charting library. It's already done and it's working as you can try here: https://play.google.com/store/apps/details?id=com.diogopicarra.adslspeed.free I see no reason not to accept this. If something is wrong just tell me and will try to fix It.

xpete avatar May 08 '18 12:05 xpete

Great app and feature.

I second it for merging.

On Tue, May 8, 2018 at 9:38 AM, xpete [email protected] wrote:

It's not possible to do this with a TextView because it's not possible to put a TextView between the chart and the legend. If it was possible I would have done it. Before using this library I tried all Android charting libraries I've found and none of them had everything I need but from what I remember all of the others had axis title. I figured It would be easier to fix this library than the others. It's also the most requested feature in this issue tracker. If I was going to to a charting library It would be one of the first things i would. It's just implementing basic chart library stuff. It's already done and it's working as you can try here: https://play.google.com/store/apps/details?id=com. diogopicarra.adslspeed.free I see no reason not to accept this. If something is wrong just tell me and will try to fix It.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PhilJay/MPAndroidChart/pull/3399#issuecomment-387388088, or mute the thread https://github.com/notifications/unsubscribe-auth/AFwaCHVJd2vlqztvoEznj5C3EwA3Ema9ks5twZG9gaJpZM4PLBVA .

andrebstv avatar May 08 '18 14:05 andrebstv

I'll reopen this. I stand by my opinion that a TextView is better, and you can easily change the legend position by the way.

However my opinion doesn't matter as much as the users, as this library is built on user contributions, like this one.

almic avatar May 08 '18 15:05 almic

None of that option allow me to put the title between the legend and the chart.

xpete avatar May 09 '18 08:05 xpete

Edit: Sorry my bad, offset calculated in this pull request.

Need to add titleHeight to offsetBottom in case Legend is disabled. Take a look at calculateOffsets() in BarLineChartBase. And I'm working with title position of those axis

trantuananh1996 avatar Jun 01 '18 04:06 trantuananh1996

Will this PR be merged any time soon?

This is also a feature that our team needs.

luizfp avatar Sep 20 '18 14:09 luizfp

Any updates on this?

devonhuangcodes avatar Nov 30 '18 05:11 devonhuangcodes

I gues it will not be added to the library, Just work with the layout adding textviews

axoaxel avatar Nov 30 '18 05:11 axoaxel

I need the axis titles between the bottom legend and the chart that’s the only issue. I don’t think textviews help

devonhuangcodes avatar Nov 30 '18 06:11 devonhuangcodes