-
-
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 in BarChartView become invisible if the x-value in DataEntry is of certain values #1716
Comments
Yes, if I divide the timeInterval by 10,000 (which obviously gives the wrong date) then the bars in the graph are visible:
Otherwise, they are invisible. |
Digging into the source code, I think the issue is in the I haven't had the time to figure everything out yet, but it looks like the code between line 176 and 194 is rounding up my time intervals for the x-axis, and therefore setting an array of incorrect doubles for the x-axis'
|
No, |
I think this is a dup to #1742. closing. |
I could fix it by sorting the values from smallest to largest x first. Very strange bug. |
When the input x-values for the data entries of bar chart are set to certain values, the bars in the chart will become invisible, while the value labels for corresponding bar are showing. I've made a sample project reproducing this issue and hope to see if I am missing something or is there something wrong.
Sample project:
ChartTest.zip
In the sample project, commenting one of the lines initiating xVal in the following method:
If the line
double xVal = i + 1;
is used, the bar chart has no problem at all, which gives the following result:However, if the line
double xVal = 86400.0 * (i + 1);
is used, the bar chart will give the following result:The x-values are setting these large as I am using it to plot chart showing data with respect to date, which those are in fact NSTimeInterval. I am kind of stuck here and have been trying some other settings like setting granularity to different values like 0.0, 1.0 as well as 86400.0, adjusting bar width, etc, but they don't work at all.
Thanks for any help!
The text was updated successfully, but these errors were encountered: