chartist icon indicating copy to clipboard operation
chartist copied to clipboard

Time intervals

Open avilaj opened this issue 11 years ago • 52 comments

I have a doubt, how can i use time intervals with chartist? I have some series that runs across months, days, hours and years.

avilaj avatar Dec 15 '14 21:12 avilaj

Can you elaborate a bit more? Maybe provide an example on what you'd like to do?

gionkunz avatar Dec 16 '14 08:12 gionkunz

Let's say that i have the following data in pseudo-code

var values = [1, 2, 3, 5]
var dates = ["Jan 1 2014", "Jan 2 2014", "Jan 3 2014", "Jan 5 2014"]

What i want is that in the bar chart prints also the missing day (Jan 4 2014). This situation is also for intervals of hours, minutes, years, months

Any tip on this case? Thanks in advance,

avilaj avatar Dec 17 '14 17:12 avilaj

Hey there. Timeframes are not supported currently but Ive also thought about this as its quite a common use case. Lets leave the issue open and track any further demand

gionkunz avatar Dec 19 '14 10:12 gionkunz

In the meanwhile you could always have your own transformation function that generates the data object for chartist.

gionkunz avatar Dec 19 '14 10:12 gionkunz

+1 for this feature!

KoltonG avatar Dec 24 '14 14:12 KoltonG

+1 this would be great to have

rogatty avatar Jan 22 '15 18:01 rogatty

+1 for this!

SpaceK33z avatar Jan 22 '15 18:01 SpaceK33z

In a similar vein, I'm trying to use time as my y axis data. Right now it seems to automatically convert it to total milliseconds, is there any way to convert it to a formatted string? I.e. "2:57" or "15:24"? Thanks!

LCid avatar Jan 30 '15 17:01 LCid

Hi,

I'm working on DateAxis/LineXY feature (https://github.com/baks/chartist-js) I asked Gion Kunz about this features to make a pull request.

Simple example here: http://jsbin.com/yevewanuya/3/edit?js,output

baks avatar Jan 30 '15 21:01 baks

Hi @baks ! Wow you were really fast with this :-) I'll do a new push this weekend where the Axes code is further stabilizing. Maybe you need to update your code based on that.

gionkunz avatar Jan 30 '15 21:01 gionkunz

How's this going? Would love this feature.

blysik avatar May 08 '15 22:05 blysik

@blysik I'm working on a code restructuring right now. We should simplify the code once more and then introduce more flexibility to the existing line chart so that the axis can be configured freely. Let's see whats the progress but I hope to have something soon.

gionkunz avatar May 09 '15 07:05 gionkunz

:+1:

optikfluffel avatar May 12 '15 13:05 optikfluffel

+1

zol avatar Jun 05 '15 19:06 zol

Hi guys. The groundwork for this is here in 0.9.0 but I didn't have time to implement the new dynamic axes for the bar chart. I have some stuff that needs testing and some fixes in my stash so I'll probably very soon publish 0.9.1 with this update so that bar chart can also use axes dynamically. For line charts you can use this feature and check the documentation here: http://gionkunz.github.io/chartist-js/getting-started.html#switching-axis-type

gionkunz avatar Jun 10 '15 09:06 gionkunz

:tada:

bartveneman avatar Jun 11 '15 06:06 bartveneman

Hi, I using 0.9.1 has the time interval feature done yet? thanks

kossel avatar Jun 25 '15 18:06 kossel

Hi, you can already use x / y data and a timestamp to plot a chart, however, there is some manual effort involved in creating the ticks for you chart. This will be solved once we have a full fledged TimeAxis implemented.

Check this example with Dates and a FixedScaleAxis: http://jsbin.com/lokozu/edit?html,css,js,output

gionkunz avatar Jun 29 '15 19:06 gionkunz

:+1: great! Thanks a lot :dancers:

khanhhaduc avatar Sep 07 '15 02:09 khanhhaduc

+1 - this would be very handy

dhruvbhatia avatar Sep 09 '15 13:09 dhruvbhatia