Skip to content

Instantly share code, notes, and snippets.

@robyngit
Last active September 13, 2023 19:22
Show Gist options
  • Select an option

  • Save robyngit/89327a78e22d138cff19c6de7288c1cf to your computer and use it in GitHub Desktop.

Select an option

Save robyngit/89327a78e22d138cff19c6de7288c1cf to your computer and use it in GitHub Desktop.
D3 v3 time-series line chart
@Thamjith
Copy link
Copy Markdown

Can I get a license for this project?

@robyngit
Copy link
Copy Markdown
Author

Hi @Thamjith, thanks for your interest! You're free to use my project for non-commercial (not-for-profit) purposes, and attribution would be appreciated. I've added a license (LICENSE.md) for clarification.

@om35
Copy link
Copy Markdown

om35 commented May 6, 2021

Hello, how we can add tooltip on this graph (for example vertical line with information on point ) please to show the count on a particular point , thank you very much @robyngit

@robyngit
Copy link
Copy Markdown
Author

robyngit commented May 6, 2021

@om35, we used a variation on this chart in MetacatUI. It's a bar chart instead of line graph, but it includes tooltips with the count and date. Alternatively, an example like this one might be helpful!

@om35
Copy link
Copy Markdown

om35 commented May 10, 2021

Hello @robyngit i tried to convert code to v4 but i have this error , can you help me please :
Uncaught TypeError: e.range is not a function
at Function.Va.h.ticks (d3.v4.min.js:2)
at e (d3.v4.min.js:2)
at ut.call (d3.v4.min.js:2)
at common_behaviour (d3v4_clean.html:601)
at draw (d3v4_clean.html:590)
at ut.call (d3.v4.min.js:2)
at d3v4_clean.html:360

the code is available here :  https://jsfiddle.net/d7j6k09r/ please help me 

@robyngit
Copy link
Copy Markdown
Author

Hey @om35, here are the D3 v4 release notes. This is a good place to start when figuring out how to transition from version 3 to 4. If you haven't discovered it already, there are lots of great d3 examples on observable, maybe there's something there that would fit better with what you need, without having to modify it too much.

@suidev988
Copy link
Copy Markdown

how do I make the x-axis show date and time too? Example, June 2 12:05:30 when zoom in?

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