-
-
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 does not respect the draw order. #4223
Comments
I take a look at the order is respected, however, it seems that the drawHighlight is drawing new shapes right upon what has been drawn; meaning it's like the highlight bars are covering the normal charts, which leads to what you said. This is likely by design. so... |
In highlighting an element, I would expect the bar to retain its place in the view hierarchy and change the color of of the selected bar. What you're saying is a new bar is drawn on top of the existing bar. What would you suggest as the correct way to change the color of a selected bar while respecting the draw order specified when declaring a CombinedChart object? |
Highlights are always drawn on top, because the whole point of a highlight is dismissed if you can't see it. We may be able to configure this behavior in the future, but not currently. If you need to temporarily change the color of a single bar for other reasons than a highlight, in some cases you can change the color in the dataset (when you have as many colors as bars). Or you can make a PR for setting a color to a bar entry (should be very easy), or for refactoring the highlight code (quite complex). |
What did you do?
I created a CombinedChartView with a CombinedChartData object that has BarChartData and LineChartData with default draw order.
Default draw order places the BarChartData at the back and LineChartData at the front.
I configured LineChartData's
highlightEnabled
tofalse
and BarChartData'shighlightEnabled
totrue
.What did you expect to happen?
When I highlight a bar chart entry, I would expect the highlight to respect the draw order and remain underneath the line.
What happened instead?
The highlight disregards the draw order and draws in the foreground, obscuring on the line rendering.
Charts Environment
Charts version/Branch/Commit Number: 3.4.0
Xcode version: Version 11.1 (11A1027)
Swift version: 5.0
Platform(s) running Charts: iOS
macOS version running Xcode: Mojave 10.14.6
ℹ Please link to or upload a project we can download that reproduces the issue.
Unable to provide
The text was updated successfully, but these errors were encountered: