-
-
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
Synchronizing scrolling/pan/highlight of multiple views. #1415
Comments
The reason I just mention 'ChartTransformer' and 'ChartViewPortHandler' is we don't have a working solution and I didn't implement it. What I mean is these classes contain the methods and show you how the zooming, scrolling works. Syncing between charts especially for the zooming/scrolling state requires you understand the library in depth..I can't talk in details because it's too many to say.. It's better that developer can walk through the code themselves.
There are As for the highlight... I don't see issues with the code and don't fully understand are you talking about library bug or just you don't know how to use it. And again.. should be easier to debug on your side. Knowing the library takes time, so.. |
Thanks I will look into what you mentioned. I thought I read in another issue that refresh was not the solution but I will try that as well. As for highlight or the crosshair more importantly if there is only a candle in the top and a line in the bottom I see no sync between the bot to the top but the top translates to the bottom just fine. If there is a combined line/candle in the top and a line in the bottom I get very sporadic results especially if the line in the combined upper chart has fewer data points than the candle. I will open another issue for that and be more specific once I do some more detailed testing. Thank you again for the point in the correct direction for the xAxis sync. |
Highlight takes x index, data set index, entry index etc. in order to correctly highlight the object you want. When you syncing highlights between charts, you have to think about is the index correct for each data set. e.g. the highlighted line dot circle data set index/entry index may not be same in another line chart, although they look the same. |
Excellent, thank you for the direction. With a little help from an example for mpandroidchart at http://bit.ly/2c7bRfU I was able to put the below function together. Works quite well. How would I restrict the matrix to only apply to the xaxis? I do not want the function to affect the y value of either chart only the pan back and forth in x. In the mpandroidchart example the answer is using getValues() and setValues() on the returned matrix. Do we have something like this so I can specify only the otherVals[Matrix.MTRANS_X] like the answer does and skip the scale?
|
This works but it may be more complicated than it needs to be. Also I would like to use functions specific to the library rather than calling swift specific functions so when I port over to Java using mpandroidchart then I do not need to reformat to Java functionality but just use the mpandroidchart libraries counter part.
|
I know this question has been asked but in each response I found the answer was really vague and only mentioned looking at the ChartViewPortHandler and ChartTransformer classes but did not detail how the solution should be coded.
The translate is my biggest problem. When I move one chart in the x axis I want the other to fallow.
I have the main view controller class set as
With the fallowing set in the view did load:
I have tried the fallowing to synch the x axis translation but it does not have any effect:
I have half way solved the highlight line but it does not work in both views.
The fallowing function passes the crosshair/highlight line from the above combined (candle, line) chart to the line chart below but clicking in the lower line chart does not sync with the upper combined chart. It does work to some degree if I move around in the lower view it will finally draw in the upper at certain locations .
Please be specific with examples if possible.
Thank you,
R
The text was updated successfully, but these errors were encountered: