-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get back x-values for BarChart[Charts 3 migration problem] #1688
Comments
did you figure this out? |
Nope, didn't get it Am 24.10.2016 um 23:22 schrieb Ace Green <notifications@git.luolix.topmailto:notifications@github.com>: did you figure this out? You are receiving this because you authored the thread. |
same problem. not figure out yet |
@danielgindi Any idea how to solve that problem? |
I'm really interested on this, need categories (strings) on the x-Axis, not doubles |
Same here! very frustrating. I appreciate the work that has been put into this but i'm considering using another charts project because of the x-axis problem. |
I don't know if you read the release notes or played with ChartsDemo, but x axis no longer works as index based one. Not it works like y axis. For example, the Bar chart in ChartsDemo did exactly what you need. If you want to have strings, just conform to If you want to sure every x axis label, set It's a big change indeed, but I believe the new x axis is more flexible to use. |
Here is my problem. My barchart has grouped bars. I want to set a x-string for each group yet do not know how. Tried axisformatter. |
My solution was a custom Formatter that inherits from AxisFormatter. Then you can set your x-axis values to count from 0 to z. Now you hand over your x-strings as a [String] and can set the right through the values. Hope that helps you. |
@patreu22 can you add some sample code to show this? |
Thats my code XAxisFormatter:
And that's the code how I formatted the xAxis:
For that solution its important that your x-values iterate from 0 to z. Hope that helps! |
@patreu22 it does, thanks for this. Managed to test this out and get it working. Now I have to deal with formatting the font it seems. How did you deal with overlapping labels? Sometimes change for the sake of change isn't good. How is subclassing a formatter easier than just passing an array directly like before? I can see this as a customization option for advanced usage but the older way should have still remained. |
For the Font-Problem, does xAxis.labelFont helps you? I don't have a problem with overlapping labels..maybe "\n" is a solution? |
Yea I already had labelFont.. I think it would work if that second unexpected "Buy" label wasn't there. Oh thats my app StockSwipe. What are you working on? |
On a little Education App that also features learning statistics... I hope you can figure it out! |
Vielen dank :) .. So it turns out that duplicate is because the values are not equal the number of datasets. Edit: Seems Chart 3.0 is designed for maximum customization and advanced usage but this makes basic usage not easy.
|
@acegreen I have a similar problem, the first label is duplicated and I can't figure out why. What do you mean by "the values are not equal the number of datasets"? |
@dbmrq by that I mean I meant that I had for example 4 dataset points, but the x values were 5, or so I thought. It turns out that if you bring the value in your subclass it will be something like 0 0 1 2 3 instead of 0 1 2 3 4. i don't know why the first label is duplicated but if you read my edit, setting the granularity = 1 fixed the problem. |
Note that in Charts 3.0.1 there's an |
@acegreen Ah, ok, now I get it. Thanks! @danielgindi Oh, now I'll have to remove all those |
Oh no, that hint would have been a real time-saver for me @danielgindi haha Am 21.11.2016 um 19:08 schrieb Daniel Marques <notifications@git.luolix.topmailto:notifications@github.com>: @acegreenhttps://github.com/acegreen Ah, ok, now I get it. Thanks! @danielgindihttps://github.com/danielgindi Oh, now I'll have to remove all those IAxisValueFormatter classes I just implemented, haha. Thanks! :) — |
I will add this IndexAxisValueFormatter in the 3.0.1 release notes. |
Hello,
I'm trying to get started with Charts 3 but I've got some migration problems.
That old Charts code created a Bar Chart with a history for right and wrong answered questions and writing the Day on the top over the belonging Bar.
I've built it with the following code:
The getDataEntries(...) function does the following:
After the update I've tried everything to bring the Dates back to the Chart but I can't make it.
Does anybody know which attribute I should manipulate for achieving my goal?
Thanks for your help!
Patrick
The text was updated successfully, but these errors were encountered: