Giter Site home page Giter Site logo

Add day chart about bird-tracking HOT 10 CLOSED

inbo avatar inbo commented on June 3, 2024
Add day chart

from bird-tracking.

Comments (10)

bartaelterman avatar bartaelterman commented on June 3, 2024

Currently, the chart shows the timestamps on the x-axis that are present in the data. In order to be able to set the x-axis to always show 24 hours, I would need to know how to pass missing data to C3. Do you know how to do this?

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

The default C3 tooltip is shown. If we leave this on, I think it should have the same style as the heatmap tooltips.

from bird-tracking.

peterdesmet avatar peterdesmet commented on June 3, 2024

To answer your question, I'd have to see the current chart: I don't see it in the live application, is it already there?

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

pushed!

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

To explain it with code:

The data format is something like:

{
    columns: [
        ["x", 1, 2, 3, 4],
        ["distance", 20, 10, 4, 23]
    ]
}

Currently, if one or more timestamps would be missing, the arrays would just have less then 25 values. If we would try to fix the x-axis, I think you need to make sure you always provide a column array with "x" as first element and next elements ranging from 0 to 23. But say you don't have data for 0h, then what do you put on that position in the "distances" array? null?

from bird-tracking.

peterdesmet avatar peterdesmet commented on June 3, 2024

Yep, null works. Or, you can set axis type to timeseries: http://c3js.org/samples/timeseries.html, but then you need to pass a date.

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

Ok, I'll make sure the first array in the columns property always contains 25 elements ('x', and 0 to 23) and the next column contains null if there is no data for a given hour.

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

fixed here: bbef7b7

The chart does not connect dots if there is no data in between. (see for example bird Jurgen, on February 3, 2014). Exactly what we wanted.

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

When year or month is selected, show some explanatory text in the div This could be done with the empty tag from C3 but then the chart must be initialised immediately (and never be removed completely) and the user will always see the axes.

The other option is to just insert text in the div by default, and show/hide that as appropriate.

from bird-tracking.

bartaelterman avatar bartaelterman commented on June 3, 2024

Implemented the text in 25cf33a.
Text can be changed if preferred.

from bird-tracking.

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.