-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Fix scaling logic in QgsHistogramDiagram to ensure linear proportions #64363
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
Conversation
7d79667 to
f32ddea
Compare
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
98a6d34 to
51ebc4a
Compare
70e60c4 to
2401d22
Compare
4821d76 to
d42fd23
Compare
|
Hi! I have fixed the scaling logic for the Histogram diagrams to make sure they are proportional. I also fixed the build errors for MacOS and Linux by using the correct header. |
|
@TONY8779 can you confirm the changes are as expected in the diff? https://github.com/qgis/QGIS/pull/64363/changes I see only an include change |
"Yes, I confirm that the changes in the diff are now as expected. |
|
@TONY8779 that doesn't make any sense |
c1cbd7d to
8552d54
Compare
|
|
@TONY8779 can you confirm the changes are as expected in the diff? https://github.com/qgis/QGIS/pull/64363/changes Please do have a look at this link and check before confirming!! |
|
Also, so that we can appropriately review -- can you confirm whether or not these changes were ai/vibe coded, and whether you've built yourself to test |
|
Hi @m-kuhn and @nyalldawson. I have reviewed the diff and confirm that these are the changes I intended to submit . While studying the code in qgshistogramdiagram.cpp , I realized the original formula was inverted , which caused the bars to scale incorrectly as values got larger . I updated it to s .size .height() / maxValue to ensure the scaling is linear and proportional.I learned how the diagram renderer calculates sizes by comparing this class with unusual working diagram types in the QGIS core. This helped me understand the exact relationship needed for correct linear scaling. |
|
Thanks @TONY8779 , could you add a small sample project that demonstrates the problem as well as a screenshot that shows what it looks like before / after and include the attribute values that are being visualized? |
8552d54 to
d93ee66
Compare
73fdb48 to
43a39da
Compare
|
I fixeD a scaling bug in histogram diagrams where bars were not proportional to their values on high-DPI screens
Linearity Verified that a value of 8000 is exactly double a value of 4000 & Orientations: Added and tested support for both vertical and horizontal bar directions& I Fix Replaced double-scaling in sizePainterUnits with a direct painter unit conversion.