Coder Social home page Coder Social logo

Comments (4)

wirew0rm avatar wirew0rm commented on August 11, 2024

As I suppose you are not showing dates from the 1970s you are experiencing this with an uninitialized chart? This is probably why this didn't show up earlier, but of course this should be handled gracefully without throwing error messages.

If your time is not unix epoch timestamps, setTimeAxis(true) should not be called. Maybe date/epoch/timestamp Axis would be less ambigious names for this functionality. And documentation should definitely be improved. (see also: #22)

@RalphSteinhagen when looking at this, I realized that the TimeAxisSample also has some problems (in master and dev). It becomes unresponsive when zooming with the scroll wheel and zoom actions generally do not work as intended.
Edit: Did some git bisect and the commit introducing the zoom bug in the sample seems to be 9ef24ea.

from chart-fx.

ennerf avatar ennerf commented on August 11, 2024

I figured the time axis would be generally applicable to any time data. I'm often using relative time, e.g., time from whenever the first data point starts.

image

Aside from the (easy-to-fix) negative number issue, starting at 0 seconds works just fine in the current implementation. Is there any reason why it needs to be limited to absolute timestamps?

Edit: I'm currently using a local fix

image

Edit2: For my use case it'd be enough to not crash, so just returning an empty string would work as well

if (utcValueSeconds.doubleValue() < 0) {
    return "";
}

from chart-fx.

wirew0rm avatar wirew0rm commented on August 11, 2024

I guess mostly because that was the assumption when the functionality was written, so you might run into cases that are wrong or at least not well tested.

One obvious (while maybe a bit constructed) example might be, that if you plot a data interval longer than the time from EPOCH to the first leap day afterwards, you will get wrong labels from this time on.
We try to make chart-fx output as independent of localization settings as possible, but there is a Timezone setting, which also could affect your output.
These are the potential problems i can think of on the spot.

Regarding your local fix, I see the problem that if you scroll out on a month timescale, you will get negative dates, which i now saw you probably also realized, returning an empty string is also what I would have proposed.
I will get some local feedback and get it merged if there are no objections.

from chart-fx.

ennerf avatar ennerf commented on August 11, 2024

That's a good point. It's ok to make this an unsupported feature that may run into corner cases. Most durations should be fairly short, so it's unlikely that users will hit this.

If someone uses a relative time with a time zone offset it's really their own fault :)

from chart-fx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.