peopledoc / django-chartjs

Django Class Based Views to generate Ajax charts js parameters.
Other
404 stars 112 forks source link

Generator for discontinuous datestamped data #43

Closed cjohnson318 closed 5 years ago

cjohnson318 commented 5 years ago

This generator is used when you want to plot non-continuous date-stamped data from a Django QuerySet. For example, you might have data spanning three weeks, but you're missing data for the weekends, and you want to express that those data points are missing.

In order to use this generator you would provide the start and end dates as either datetime.date objects, or strings with the format yyyy-mm-dd, the QuerySet of the model you're using, the name of the date attribute of the model, and the name of the value attribute of the model that you're interested in. If the QuerySet doesn't have a value for a particular date, then this generator yields a 'null'.

Natim commented 5 years ago

Interesting work. Do you mind adding and example of how to use it as well as a couple of tests?

cjohnson318 commented 5 years ago

Thanks! Will do.

Natim commented 5 years ago

Thank you for your work on this, I am merging.

Natim commented 5 years ago

Released in django-chartjs 1.4.0

cjohnson318 commented 5 years ago

Thanks!