small multiples plot with d3 in react - javascript

I am trying to create small multiples with d3 in react.
As reference i use this
https://observablehq.com/#nyuvis/small-multiples-with-different-axes
It seems to work fine, however it uses the area constructor but i actually want to draw bar charts as small multiples, and rectangles do unfortunately not have a constructor in d3 and i'm not sure how to adapt the code to work without using a constructor.
Therefore i also tried the example from the answer here
What is the best way to create small multiples in d3.js v6?
It works somehow, but in react all the bar charts are drawn on top of each other.
You can find my example here:
https://codesandbox.io/s/react-d3-small-multiples-u9ujke
Thanks for your help!

Related

Circle-Packing chart with direction links

I'am trying to create circle-packing chart like that
https://bl.ocks.org/mbostock/4063530
But I also want to create some relation between data, to show how data binds to each other, so I need to add some code to change example above to make it like on this image: Circle chart with relational links
So the question is: is it possible to add relational between children in array to reach desired behavior and change Circle-chart layout to Linked Circle chart layout?
P.S. I'm new in d3.js so I don't have deep knowledge in this field, so It would be great if you provide me some examples how to reach that
I've solved my problem my problem by myself, The solution is that to draw arrows by hands without d3 layout tools, I hope it could be useful for someone:
Circle pack with relation arrows

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.

d3.js changing style of diagonal line

I am brand new to working with with d3.js
I am trying to change the style of the links in the interactive-tree example that comes packaged with d3.js
https://github.com/mbostock/d3/blob/master/examples/tree/tree-interactive.html
they are currently beziers, and I would like them to be angular, i.e. visio class diagram style connections.
seems that there needs to be some extra definition of the diagonal around lines 42-43, but I can't tell from the documentation what that would be.
any help is most appreciated.
You can't do that with d3.svg.diagonal. Have a look at d3.svg.line and in particular the interpolate function.

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/

Draw line charts. Moving from JpGraph to Raphael JS

I've an application that based on some values from different inputs (temperature, humidity...), show different charts.So far I've done that with JpGraph, and I found it pretty easy to do. You can add a legend easily, and plot as many functions as you want. You can also fix the scale easily. Regardless of that, I would like to have some interactivity with the user (I just want that one the user clicks on a point of the graph, the X and Y value are shown). That is not easy to do with JpGraph because it is just a PNG image.
I was recommended to use Raphael JS library, and I've been reading to the documentation (Raphael JS Reference), but I don't see that what I want to do (line charts) is that simple.
So, I am asking, to both Jpgraph users and Raphael JS users if they had had experience with this, and if there is any good tutorial online (I have not able to find one that works with line charts). The kind of graphs I'm drawing now are like this: JpGraph Example
Some other options:
D3.js (SVG)
JSXGraph (SVG and VML for IE)
Protovis (SVG)
There is a chart plugin for Raphael. It supports line charts. The documentation is certainly lacking - but there is always the source.
Answering myself. After doing some research, I found this one pretty interesting for doing line charts:Grafico

Categories