Link to home
Start Free TrialLog in
Avatar of Software Software
Software SoftwareFlag for Austria

asked on

Display the number of minutes in a coordinate system

Hello,
I get the number of minutes from a database.
The number of minutes should be displayed as a line in a coordinate system.
For a minute, I take a pixel.
But if I want to display 20 hours, then the line is too long.
Is there a way to display the minutes exactly by scaling down or up (without having to round)?

Is it possible to display for a minute 0.5 pixel?

User generated image
Thank you
Avatar of aburr
aburr
Flag of United States of America image

Is it possible to display for a minute 0.5 pixel?
no
Avatar of pepr
pepr

Generally, you should not be pixel oriented during the solution.  If the abstract resolution is one minute, then choose the minute as the unit. If you know the pixel range for displaying one value (minimum and maximum), then just calculate how big value (line) should be displayed, and round the result. You cannot spot one-pixel difference, anyway.
As pepr said, "You cannot spot one-pixel difference, anyway." And this makes me wonder why you want to have a pixel represent a minute.
If you have a 4K monitor, then no problem getting 1200 pixels horizontally. Or with HD monitor, you can draw the minutes vertically.
You can look at the min and max minutes in the database, and try to scale with a smaller domain.
Use a percentage of the max. One graph you may have a maximum number of hours as 20 and on another 10 or 30. Then display the number you want to graph as a percentage of the max.
24 hr * 60 min/hr = 1440 minutes

my monitor is 1920 x 1080, so 1 minute would be 1.33 pixels!

have you thought of using 2 minute intervals?
Have you thought of using a logarithmic axis? It may be a bit tricky if you want the axis to show hours and minutes (wish time used a decimal system!), but it will get around the problem of very short intervals.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.