-
-
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
XGrid not in sync for identical x values but different chart types #99
Comments
I think I saw a similar issue open in the android repo... בתאריך יום שישי, 22 במאי 2015, AlBirdie notifications@github.com כתב:
|
Well, a CombinedChart by itself has only one xAxis. The issue comes into play when you've got several CombinedCharts in a single UIView positioned below each other. In that scenario the x axes of those two CombinedCharts are only in sync when you actually have identical chart types in both CombinedCharts. |
Can you make a screenshot? |
Sure. Top chart is a combined chart with LineData and CandleStickData, Volume is a CombinedChart with BarData and LineData, rate of change (ROC) is a CombinedChart with LineData only, and the MACD is again BarData and LineData. I've explicitly removed the BarData from the (ROC) to demonstrate the issue. Add the BarData again and everything's in sync again. Note that all charts share the exact same x data values. |
Oh now I get you... it really is weird... @phil any ideas? |
That is weird, but then I haven't seen this project yet … which is unfortunate as I've been hand rolling my candlestick charts! |
Does this still happen? |
I'm gonna check with the latest version first thing tomorrow morning. |
Looks good thus far! Excellent! |
:) |
On further inspection it shows that this only works if 'setStartAtZeroEnabled = YES'. If you disable this, and add nil values to a dataSet (meaning you just omit certain values), the grid still runs out of sync. |
@AlBirdie I guess it's not guarenteed what would happen if you add nil to your dataSet? If want omit, just not add at specific xIndex |
With omitting I mean not adding them. |
Take two charts, vertically stacked in a UIView.
Make one chart a BarChart, the other one a LineChart and feed them with the exact same data.
Once you zoom in, you'll notice that after a certain point, the x grid lines start to spread.
In order to mitigate this issue, I've created some 'ghost' (clearColored) BarDataSets for all my charts that show LineData only (all of my charts are CombinedCharts, but that doesn't really matter here as the issue is present with single type charts as well), so that the x grid stays in sync, which it does in case all charts show the same type at once (in my case, CombinedData with a 'ghost' BarDataSet on all charts).
Now, that workaround wouldn't necessarily be an issue, but given that more DataSets cause more load on the CPU, hence slower performance of the library, I'd like to avoid such trickery if possible. Not having to render an extra set for each chart would heavily speed up our chart on slower devices such as the iPhone4S or the iPad2/3.
The text was updated successfully, but these errors were encountered: