How to use the D3 Diverging Stacked Bar Chart - javascript

I am trying to implement the Diverging Stacked Bar Chart: click here
I however I'm finding it difficult to understand how to set this up in a local environment. I've downloaded the code but I want to be able to change things on load where as it seems to be a static html template.
I'm basically asking for a link to a tutorial on how to use this lib as the documentation is awful or a tutorial on here.

Related

d3js v5 : Can't figure out how to use Observable notebooks

I'm trying to build a "stacked normalized horizontal bar chart" using D3.js v5.
I found an Observable notebook which shows exactly what I need :
https://observablehq.com/#d3/stacked-normalized-horizontal-bar
I would like to display this exact chart in a "classical" HTML page.
I don't understand how am I supposed to do this : do I need to copy every line of the example (in reverse order) into a Javascript file, and then embed it in the HTML page ?
My final goal is to create a VueJs 2 component to display this kind of charts.
I'm a bit lost, and I'd really appreciate some help to get started...

D3.js background gitter

i wasnt quite sure what to call this question but so far i have been unable to find what im looking for.
First an image:
This is taken from chart.js
Right now im trying to create my own costum chart but i want it to feel abit like chart.js so here is my chart created with D3:
Now on the image from Chart.js you can see the background has some sort of indexing. I was wondering how is that possible with D3?

Stacked / Nested / Overlapping pie chart and donut chart with javascript

I am not sure if anyone has come across this scenario or has even made a solution but basically I am able to create simple Pie and Donut charts using Flot Charts. What I am looking for though is a scenario where there is a pie chart in the center and it is surrounded by a Donut Chart. Very similar to this question but that question is now 3 years old and was never really answered.
I tried creating two charts using the same DIV but then one just overwrites the other. I thought of creating two different charts on two different DIVs and having them overlap but that just doesnt seem like a clean approach that will also accommodate responsive behavior.
Any thoughts / suggestions are welcome.
Thanks in advance
The answer to this is not simple as some of the comments have already indicated but I did find something that comes pretty close - HighCharts. They do have a con-centric donut chart that gives exactly the look and feel desired - infact LinkedIn uses them to display their dashboard statistics. The downside to Highcharts is that it is a paid library and its not cheap if you are planning to deploy on a commercial web application
The alternative is to use MorrisCharts - http://morrisjs.github.io/morris.js/donuts.html
They do have some good donut charts that come pretty close to the need.

ready to use dynamic pie chart in d3.js

I am evaluating to change the graphics I generated so far using highcharts.js to d3.js
just for fun and I want to learn how d3.js works.
I wonder if there is something similar to the url below (see if you click on a pie it gives you new data), something dynamic and ready to use (or not to implement from zero).
What I wanna achieve, more or less...
http://lully.snv.jussieu.fr/gbif/mapping/graphs/examples/pie-legend.htm
thanks in advance
Pere
If you want to replace Highcharts, I think the only good open-source alternative available at the moment is Bob Monteverde's Novus charts library: http://novus.github.com/nvd3/. NVD3 has a nice pie chart and also has good legends. Take a look at all the charts from this library and you will see what I mean. You can also find a good pie chart in Stephen Boak's tutorial: http://blog.stephenboak.com/2011/08/07/easy-as-a-pie.html. Another interesting option is to look for Frank Guerino's questions on the D3 js google group. I would use NVD3 if I were you. It might need some adjustments, but it seems to be the best option currently. Good luck!
Simple function to generate Pie Charts utilisiing d3.js. This function is part of the http://xhprof.io/ project. It is able to handle datasets of arbitrary size. It has several options that allow for customisation, such as the label margin, circle radius and visibility of the percentage data (refer to the source code).
The demo is available at https://dev.anuary.com/858b33b7-bd66-507b-a9f1-533e4de79ba3/. The source code is available at https://github.com/gajus/pie-chart.

Google Chart Visualization API, Bar chart values / tooltips

I am trying to add the actual value of all the bars in my chart to the
end of each bar. I want this to either replace, or to add to the tool-
tip functionality.
I see that this is possible in the image chart, it is the
functionality described in the following link that I wish to
replicate:
http://code.google.com/apis/ajax/playground/#image_bar_chart
I am wondering if this is possible in the Javascript based version of
the bar chart?
Many thanks,
H.
It looks like there's no built in functions to draw text ad-hoc on top of google's different charts. Behind the scenes, it's generating SVG so you could try to insert some valid SVG on your own.
Another option would be to use a more flexible (but less featureful) library like raphael.js:
http://raphaeljs.com/

Categories