-
-
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
Enhancement: Linked x-axis or stacked y-axis. #1022
Comments
well it's a highly special chart, looks like put 3 different charts together, just with same xIndex. That's a workaround. For the native support, I guess it's beyond the purpose of this library and arch. It's nice to have, but a lot of work to be done in order to achieve so. If you can work it out and file a PR, you are more than welcome. |
Thanks @liuxuan30,I think I may have to do that. For now, how can I set the chart to be displayed with a set min and max x axis? Is this possible at the moment? Using ChartView.highestVisibleXIndex and ChartView.lowestVisibleXIndex would get the values in chartTranslated function. I'm not sure how to use those values to resize the other charts. If this is not implemented in any intentional way, do you know what functions/classes are used to set the x-axis viewable limits? |
@liuxuan30 I have implemented a fix for linking navigation, it is not implemented in the library so i guess it's technically a work around, but the behavior is the same as "real" fix would be. What do you think the best way to implement this in the library is? Maybe package it so you can use chartView.linkedCharts = ["identifier1", "identifier2", "identifier3"] For panning:
For pinch zooming:
to this
in BarLineChartViewBase.swift and update the protocol method it is calling in ChartViewBase to be this: optional func chartScaled(chartView: ChartViewBase, scaleX: CGFloat, scaleY: CGFloat, location: CGPoint)
|
try |
that was the first thing I tried. It didn't work, I like my solution better because it actually links the user input. |
if setVisibleXRangeMaximum not work, then a bug I guess, though I don't know why and how to fix. Sorry that you had a lot of info that I can't digest in a short time. |
It's not entirely a bug. Even if that feature worked as intended it would not present the desired behavior. If I pan on chart A, with chart A zoomed in, so that new data is shown I want the same type of "scrolling through the data" animation on/in charts B and C. With setVisibleXRangeMaximum working correctly, charts B and C would be reloaded with the correct data limits, but the scrolling or zooming animation wouldn't be present. This would be very visible if gridlines were enabled on the xAxis. |
I think that with the current callbacks and methods - you could easily sync the viewports between charts... |
I need to plot data over the same range, but with drastically different values. It would be great if there was a way to stack/merge plots so the x-axis limits remain the same with any gestures. This means y-axis scaling and values would remain independent. It would also be great if the vertical line used to focus on a single data point could extend to all of the plots.
Image showing what this enhancement could be applied to:
The text was updated successfully, but these errors were encountered: