-
-
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
Bars not showing bar chart #1742
Comments
Any one has a solution for this? Thanks, |
How do you set it up? Chart 3.0 has redesigned x axis, so lots of things changed. If you don't update your code, it might be missing. For now, please check ChartsDemo for different bar chart demos. |
I will run the Demo charts again and see if i can reproduce the issue, but i believe the issue is similar to the other issue #1716 opened. Let me get back to you once i make some changes and running the Charts Demo. It seems certain x-values are causing issues. Thanks, |
I'm having the same problem. My X-axis correctly shows the date in format YYYY-MM-DD but the bars are invisible. |
@liuxuan30 , I made the following changes. instead of X value being a double, i am adding the datetime since 1970 which is the double value for the dates. Also attaching the code for the BarChartViewController.m that way you could check it. Either i am missing something very simple or this is a bug. Thanks, |
Hi, I am not sure why this issue is closed, but like everyone who has described the symptoms here and in #1716, I am experiencing the same bug in our project. In short, the X-axis can't seem to handle large values such as time intervals, and it somehow messes up the rendering of the chart. |
@sjuvvalapalem the original ChartsDemo works fine right? I don't know the context about your changes. In Chart 3.0, x values are always double. If you changed anything, make sure you change all related field. You screenshot is just missing the bars, so I think you could check |
BarChartViewController.m.zip I think this could be a bug. Please look at the attached zip document, you could easily figure out the changes i made and that should make sense. Any solution to this would greatly help. Thanks, |
@liuxuan30 could you please make this issue Open? so that this gets more traction just like the others mentioned. Thanks, |
I m sorry that I'm busy with my work recently, so I can't take a look at this very quickly. Will try |
@liuxuan30 yes, it is a double. With the formatter, the dates show up correctly. the values above the bars show correctly. Everything is working but the bars are not showing. If you are busy, Is there any one else who could look into this issue/bug? Thanks, |
alright, I did a quick check.
When rendering, barRect width is too small:
So you don't see it.
then
it's trivial. @danielgindi seems like we need to handle The x range is very large, but just a few bars, however we use a hard coded number to present the bar width, which causes trouble. I tried to "normalize" the barWidth, buggy. The temporary workaround is to uses bigger day units, not seconds for x values. Or you just turn it into 1,2,3,4,.. and let the formatter to format. In your data, your x vals are over one year, even in days, it's 365 bars and the bar would be thin too. Another way is to change |
Hi, Thanks |
setting BarChartData.barWidth to huge value (~10 000) solved problem for me |
I got around this issue by setting a border |
Setting barBorderWidth seems to fix the issue. |
Any solution for this issue? Setting barBorderWidth seems to work but it doesnt really work the right way because if there is only one or 2 data points the lines are too thin (assuming you set it the barBorderWidth to 1). If set to a higher number then all the bars are joined and mingled together and doesnt look good. Any work on this is greatly appreciated. |
Work Like A Charm ! My Analysis: this is wrong code:
This is wrong code:
This is incorrect code:
this is wrong code :
this code work like a charm:
This is my full code and tell everything about xValue and xHelper.
next make this class and thanks to Phillip Jahoda
finally make MainActivity class:
Everything is done. And this is my Description: I don't use this code:
because i need dynamic input and don't want write "jan", "feb" and so forth. my solution:
And i don't use this code because -->
because that
the point is, And this is the secret:
|
@sjuvvalapalem @avitus did you find any solution for this. |
It's been 2 years now since this bug was reported, and there's still not a fix? |
can you file a PR to fix this? I originally marked it |
Not sure if this helps anyone, but I had the same problem and solved it by setting my bars to correct size relative to the range of the x-axis:
|
This one works better then #1742 (comment) when u have some missing values in between your data range, ie. non continuous and periodic data source. If you have missing values in between, setting BarChartData.barWidth to huge value (~10 000) looks like But both works great when u have all sufficient continuous values |
I just lost 3 hours for this, so keeping an eye on it. Ended by using indexes. |
Hi there! I Find new solution to solve this problem.
How to create ChartDataEntry
And formatter look like this
|
I'm still facing issue, I had tried all solutions mentioned in different comments but they don't work. setting bar width fixing issue of showing bar but selecting bar does not work. |
This workaround works for me. This is still a bug. |
Hi,
Ever since upgrading to 3.0, i am having trouble with the bars not showing in the bar chart.
One bar shows when the data has only one point. If i add more than one point then the bars donot show.
This is happening only when the xaxis has dates. if i change the data from dates to say integer then it works fine.
Please see the attached screenshots.
A sample of the data would be similar to this
{
"09/04/2012":"245",
"02/05/2013":"227",
"04/07/2013':"234",
"07/08/2015":"244",
"10/11/2016":"2254"
}
Thanks,
Bob
As seen below i dont see the bars at all? what seems to be causing this?
The text was updated successfully, but these errors were encountered: