> On 7/13/16, 7:46 AM, "chg...@googlemail.com on behalf of Ch'Gans" 
> <chg...@googlemail.com on behalf of chg...@gna.org> wrote:
>
> Why not use a plain QLogValueAxis for your X axis, if you're talking
> thousand of years, i guess you don't need month, day, hours, minutes,
>... on your X axis, do you? Do you need to take into account leap
> year, leap seconds? Is there a mathematical definition of
> log(date:time)
> QLogValueAxis with just years should do the job. But maybe i'm missing
> something.
>
> Looking at the source in qt5/qtcharts/src/charts/axis/datetimeaxis and
> qt5/qtcharts/src/charts/axis/logvalueaxis doesn't show complicated
> code. So this seems to be doable "easily".
>
> My 2cents,
> Chris

Chris,

I would think it safe to assume that level of precision (month, day, …) 
wouldn’t be necessary when viewing data that’s extrapolated that far, but I’d 
need to confirm with others before moving forward on that assumption.

The issue with using QLogValueAxis is that you’re still displaying numeric 
values on the labels as opposed to the actual date representation. Instead of 
seeing 12345 BCE, you’d see 12345 BCE – base year BCE (e.g., 10329 for the max 
year if the base year is 2016). That’s not necessarily what the user might 
expect, so I want to be able to handle displaying the actual date.

As far as I know, there’s no way for me to provide custom labels for a 
QLogValueAxis, converting the numeric value to a QDate(Time) representation. I 
don’t see a simple way of extending the other axis types to do this, 
particularly since their actual implementation is dependent on private classes 
(QLogValueAxisPrivate and QDateTimeAxisPrivate) that are not accessible to 
developers for extending.

If you see something I’m missing, I’m all ears.

Adam Thompson
Computer Scientist, Nuclear Engineering
Oak Ridge National Laboratory
+1.865.241.8062


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to