Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is currently no default formatting for time series < 1 day (hours, minutes, seconds, etc.) #192

Closed
jdarling opened this issue Nov 16, 2014 · 14 comments
Assignees
Milestone

Comments

@jdarling
Copy link

Needs to be a way to show data and group it by less than the day. Or to have a string value on the X Axis to be displayed by.

As an example, if you want to give a single 6 hour window of data grouped by every 30 minutes, you can't do that with the library today.

@hamilton
Copy link
Collaborator

Hi - you're absolutely correct. We definitely need a good default for this case. @almossawi we should probably move on this for 1.1.

@hamilton hamilton added this to the v1.1 milestone Nov 17, 2014
@hamilton hamilton changed the title Group by lower than day There is currently no default formatting for time series < 1 day (hours, minutes, seconds, etc.) Nov 17, 2014
@jdarling
Copy link
Author

Actually, along these lines. I have a few suggestions and am curious, do you prefer a pull request with new ideas, just a single issue for each idea, or lump everything into one issue/pull request?

I'm using this in a Hapi.js and React based application so there are many changes I've had to make to the code to make it integrate without issue and would like to share back.

@almossawi
Copy link
Contributor

@hamilton Sure, sounds good.

@jdarling That'd be wonderful. Thank you. My preference would be for a PR per idea. Hamilton?

@hamilton
Copy link
Collaborator

Yes, a PR / idea would be most ideal! Thanks.

@dashed
Copy link

dashed commented Nov 23, 2014

@jdarling I'd be interested to see how you did it.

@shawty
Copy link

shawty commented Nov 27, 2014

SNAP!! any chance i can see your push request too? I'm trying to graph data produced using MRTG so range is 00:00 to 23:59 in 5 minute increments.

@namelivia
Copy link

I'm also very interested in this, it would be great!

@almossawi
Copy link
Contributor

Moving to v1.2

@almossawi almossawi modified the milestones: v1.2, v1.1 Dec 1, 2014
@sbeam
Copy link

sbeam commented Dec 9, 2014

very much interested also; especially with data containing just epoch timestamps with a callback available for formatting.

@newjam
Copy link

newjam commented Dec 9, 2014

Yeah, I would like to use the library for server performance metrics, eg requests/second, memory usage, error rates. These are mostly useful at smaller time scale, such as 5 minute increments.

@jdarling
Copy link
Author

jdarling commented Dec 9, 2014

Sorry I haven't updated in a while, we hit a tight test-release cycle and I haven't had any time to look at this. I was basically thinking of porting what I did with d3rrc over so the time scale would self distribute over the input data. It's kinda built into D3 already, something similar to:

// First setup the basics using the chart width - margins as w
    var x = d3.time.scale()
        .range([0, w]);

      x.range([0, w]);
      xAxis.scale(x);

// Lock it to the bottom
    var xAxis = d3.svg.axis()
        .orient('bottom');

// This is the important part, setup the domain based on the input data
      x.domain(d3.extent(indexes));

// Finally display it
      svg.append('g')
          .attr('class', 'x axis')
          .attr('transform', 'translate(0,' + h + ')')
          .call(xAxis);

Would have to bucket the data before you could push it into something like that. If the goal is to self bucket then either using something like corssfilter or a similar self bucketing based on # of buckets requested and then breaking up the input would be necessary.

@hamilton hamilton modified the milestones: v2.1, v1.2 Dec 10, 2014
@hamilton hamilton self-assigned this Dec 11, 2014
@hamilton
Copy link
Collaborator

@jdarling I just made some sensible defaults for x-axis time scales that are less than a second. They should just automatically work. For now I'm going to close this particular issue unless this crops up again.

almossawi added a commit that referenced this issue Jan 14, 2015
almossawi added a commit that referenced this issue Jan 20, 2015
It appears to interfere with the change in #192
@glukgluk
Copy link

Is there a option to show the date in 24h format and not am/pm?

@almossawi
Copy link
Contributor

@glukgluk You can change the specifier on this line to any one of the ones listed here, so for instance:

yformat = d3.time.format('%H');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants