-
-
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
Last Value doesn't appear in barCharts and lineCharts #1384
Comments
Regarding the bars i have the same problem. Are you using fitBars? If yes,I guess that the problem is that in the function if fitBars
{
_xAxis.calculate(
min: data.xMin - data.barWidth / 2.0,
max: data.xMax - data.barWidth / 2.0)
}
else
{
_xAxis.calculate(min: data.xMin, max: data.xMax)
} In my case, I'm using the fitbars property, but I guess that we need to add instead of subtract the size of the barWidth/2.0 to the data.xMax this to increase the value of the range to get the extra space on the chart. In other hand this jus fix the problem with the fitBars, but I guess that the problem on the following case is about the way the library calculate the space for the groups of charts. @danielgindi @PhilJay Could you guys take a look of what I'm saying above. _FYI every group of charts has the same number of bars, so the library isn't drawing the rest of the chart for the last group also i'm using fitBars property_ |
O: @chuynadamas you are right changing the "-" symbol to "+" it solves the problem with the barChart graph:
|
@ajimenezjulio is it Chart 3.0? @chuynadamas you post this screenshot in #1359 (comment), are the same issue? |
Hey @liuxuan30, Yes, this is 3.0 and no, there is a different issue. #1359 is about the positions of the labels. Thanks in advance. |
Yep the problem #1359 is different. I think that the problem is in the function that draws the value, similar to "drawValues" in barChart but in lineChart it doesn't exist, finding where the library draws the values for its respective point in the graph we can solve the issue. The question is where it is?. |
I faced this issue as well with the LineChart. I made a temporary fix (not sure if this is the correct location to fix this) that works well. Renderers -> LineChartRenderer.swift -> line 536 ( drawValues )
add the +1 to the calculation, solves the problem. Anyone can verify if this should be the fix for the problem? this is out of topic but, drawing a bezier curve line chart has the same problem as well. The last point is not connected to the rest of the curve. |
Holy crap! you're incredible @FatsGW modifying that line solves the problem with the last value in lineChart, thank you!!! |
@PhilJay ? |
Just checked on Android, could not reproduce the issue. Maybe this is iOS only? |
This is already fixed by one of the PRs, please re-check. |
I faced this issue as well with the LineChart. I made a temporary fix (not sure if this is the correct location to fix this) that works well. Same Problem I have. Above fix is not working for me |
I have some troubles with the library, when I create a barChart I have to add an extra value to my values array in order to show all my original values, and in the lineChart the last value appears in the line graph but it doesn't have its value above the point like the others.
I let you my code and some pictures showing the problem:
BarChart: My xAxis have a custom format showing months.
LineChart: My xAxis have a custom format showing months.
The responses are: For barChart December doesn't appear and in lineChart the last value doesn't show its value above it, I hope someone can help.
The text was updated successfully, but these errors were encountered: