-
-
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
Highlight sync between combined and line views #1424
Comments
As I said earlier in another of your post #1415 Passing highlight objects may not be correct. Combined chart is composed of different data sets, each data set has many entries. If you want to pass line chart highlight to combined chart, you first have to figure out which data set index it is in Combined chart. |
Thanks again, I was not really sure what you meant in the earlier post, but this is much more clear. I will look into what you mentioned here and post my results for others once I find a resolution. What about the margins for the number differences that make the charts different sizes? |
could be some reasons. In your chart, the y axis labels is different width, so the But remember, chart view bounds - left/right axis label width - extra offset = chart rendering area width |
Excellent. That works wonderfully... =] |
I am still a little confused about the highlighter. I currently only have one chart in the combined chart (removed the other for testing) so the index should be 0 correct? I tried the fallowing and the bottom line chart is still in sync with the upper combined chart but the highlighter completely disappears from the combined chart with clicks in the lower chart.
If I use the highlightValue function in the combinedChartView if and else statements the highlighter in the combine view disappears completely when clicking in both views but the bottom chart is still in sync. Do I need to write a custom "chartValueSelected" function that takes the CombinedChartHighlighter functionality into account. The reason I ask is that when I print out the value of the
But for the line chart below i get expected results:
|
this seems an old issue in 2.2.5, by default its all -1. I would suggest you try v3 |
Yikes... !! I tried to fix as much as possible to allow the previous code to work with V3 but it has changed allot and the way I have my setChart function now will no longer work. There are 5 lines of code that have changed dramatically in the way the data entry is handed so that it does not allow me to use the same process. What were int index values are now doubles and setting the xValues with the ChartData classes before appending the yValues is no longer the same. See lines 133, 146, 168, 219, 227 in this repo. I have removed my API key so it will not load data but if I can get help reworking those processes then I can test the highlight with V3. |
I was able to convert my code to work with V3 although I am not sure if I like the way xIndex was removed, I'll explain below. As for the highlight issue with the highlight was a bug in the 2.2.5 code returning -1 for the combined chart view. In V3 the below code works as expected:
|
I am having issues with getting the crosshairs or highlight line to sync with two chart views I have.
I have two different problems, second one is detailed in next comment:
First and most important is the passing of the highlight line to the other chart:
The top view is a combined chart view with a candlestick chart and a line chart.
The bottom view is a line chart. All data is from the same source with same xValues. The yValues are the same just adjusted to illustrate the issue I am having.
You can see an example of the code: here https://github.com/moon47usaco/Highlight_Sync-01
I am using the bellow function to pass the highlight value to the other chart:
This works fine for the candlestick or combined chart to pass values to the lower line chart but not the other way around.
I have the line chart in the upper combined view set to
lineOverlayChartDataSet.highlightEnabled = false
and if i set this to true the bottom chart will sync with the line but that is not the desired result. I would like the bottom line chart to sync with the upper candlestick chart.The text was updated successfully, but these errors were encountered: