Skip to content
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

Barchart feature? #4

Closed
martonmiklos opened this issue Nov 25, 2019 · 5 comments
Closed

Barchart feature? #4

martonmiklos opened this issue Nov 25, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@martonmiklos
Copy link

Recently I was thinking about adding a barchart feature to the app similar to the ublox u-center 's barchart:
https://i1.wp.com/ozzmaker.com/wp-content/uploads/2019/10/ucenter3.png (right barchart)
or similar to this Android app:
https://lh3.googleusercontent.com/5j7YfudqXuRJyhg9Y69AefjALx0cXGarRqOUyLB_ubEMHLvsYxPIjNvGRHszqB1umA=w1400-h865

For me this feature would have been useful during a test test of an ublox GPS receiver to see how the RSSI compares to a phone. (Others might find it useful when comparing phones GPS reception for e.g.)

I opened this issue to start a discussion about this, because before starting implementing it I would like agree on the technology to be used for the chart.

Do you have any preference on implementing a barchart in QML?

It would be handful to use the Qt's charting system, however it is not shipped with the SDK, neither to the device, so it brings up some integration questions.

But if you happen to know a QML charging library which is capable of displaying a barchart please let me know. And at the end we could even draw it manually (since it is just a matter of drawing some rectangles).

@direc85
Copy link
Owner

direc85 commented Nov 25, 2019

I think that would be a nice improvement to the application and it has crossed my mind before.

Drawing, say, 10-20 strongest satellites by rectangles and a few labels is actually a lot easier task than drawing the current radar, so that's a plus. Jolla Phone handles the radar fine, and the bar chart shouldn't update tens of times a second anyway - perhaps only once per second or two.

I have a fork of qchart.js, and it's used in CarBudget and BudgetBook at least. It's not at all difficult task to order the satellites by signal strength and in-use status, and draw them, so I kinda vote for Canvas in this case.

I guess you could look at qchart.js and see how it looks? I'm somewhat handy with Canvas already, but not at all with qchart.js so I really can't tell if it's suitable or not.

@martonmiklos
Copy link
Author

Thanks for the info, I will peek into the qchart.js, it looks promising.

@direc85 direc85 added the enhancement New feature or request label Nov 26, 2019
@martonmiklos
Copy link
Author

martonmiklos commented Nov 26, 2019

And it's happening:
kép

The axis label fonts colors and sizes needs some tweaking, but it generally rolls.

I needed to tweak the qchart.js code to get the bars colored differently.

@direc85
Copy link
Owner

direc85 commented Dec 1, 2019

Thanks for your work! I tweaked the appearance a bit and moved it to the left side of the main page, so that users find it more easily. It's no use to create something new and keep it two pages away ;)

The chart itself works perfectly, but I'm really flummoxed about QChart... There are all kinds of alignment issues, there is no easy way to highlight certain bars nor the labels can't have customized style (for higlighting the satellites that are used for position calculation) and it's just so complex (although I like the centralized configuration style). It is completely adequate for this purpose though, so I released the feature today. Let's hope we get some valuable feedback from the users!

(This gave me a spark to reimplement the QChart using only QML assets, as I did with SatelliteInfoPage.qml, as it better allows for threaded and accelerated rendering, much more so than Canvas and context2d - but that's another can of worms altogether!)

As this is now released, could you test the release and close this issue if you're satisfied with it?

@martonmiklos
Copy link
Author

Works great, thanks for the added features!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants