I really appreciate your help on this - I'm fairly new to D3.
I am working on a sort of nested D3 viz. When one element in the first D3 viz is moused over, I want a second D3 viz (say bar chart distribution of the first's elements) to appear. Is this possible? Could you give me a high level overview of how to implement?
To further illustrate: Let's say first viz is scatter plot of GDP vs. population of various countries. When a particular country on the scatter plot is moused over, I want a bar chart to appear in the tooltip that shows the top 5 industries in that country.
Any help on how to approach this would be much appreciate. Thank you again!
I suggest you to take a look into Bootstrap's "popover". I like it because is very easy to use. Inside that popover you can insert SVG element and draw your second visualization.
To keep things clean and reusable, I suggest you to read this article and write your second chart in reusable manner.
Related
I am trying to plot daily tasks in what i would describe as a discontinuous stacked bar graph. Another description would be a vertical gantt chart of past events.
If the description is lacking, the result i want is something like that shown in the image below (made in paint).
All task have a duration (from-to time) and can have different categories which results in different colours with belonging legends.
I have been playing around with two javascript plotting libraries; chart.js and plotly.js, and looking at others but i haven't found anything that can do what i want to achieve. Both chart.js and plotly have stacked bar graphs, but i see no way of getting spaces in between the bars and getting the legends right.
Do anyone have an idea if this is possible in any these two libraries? If not is there an alternative library where this can be done?
Regards
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
I am working on d3.js and dc.js libraries from few weeks. I have created scatter plot in d3.js and bar graph in dc.js. I want to know that is there possibility to interact between these two different graphs created in two different javascripts. In short, is it possible to interact between two different graphs created in d3.js and dc.js?
thank you.
Not going to give you the codes, sorry.
You'll want to use crossfilter as the bridge between the graphs, though:
create a dimension which is for the scatterplot (different from the dimensions used in the dc.js charts, but same crossfilter instance)
react to the interaction in d3 and set the filter on that dimension
Often when creating a dimension for a scatterplot, you will use a key that is unique for each row, or barring that, the row index itself. If you search around for dc.js scatterplot or bubblechart, you ought to find examples.
Also dc.js has a scatterplot now. It needs some love and is not as feature-rich as the bubble plot, but it exists.
How would you implement this with d3.js:
I started with sunburst diagram, but how to handle pics around circle? How to rotate them? etc. (assume each cheese has its png pic)
To add images, you can use the SVG image tag. The elements added in this way can be translated and rotated in the usual manner. The code you're going to need is essentially the same as for a pie chart with rotated labels, for which you should be able to find plenty of examples.
Here's a quick and dirty modified pie chart example that demonstrates the technique.
Looking through the documentation for Highstocks, I found this example:
Shown here is two series on the same chart, therefore with a linked range selector - this is really really useful, but I wish to display something different which is proving to be very difficult.
What I'm looking for is a normal line graph on the top series, representing data plotted onto time (almost like in this example), but a bar chart or horizontal candle chart in the lower graph, representing one or more timelines.
I've drawn an image of what I'm looking for:
I apologise for the crude drawing, but hopefully it shows what I am aiming to achieve: standard graph on top, bar/candle on bottom.
I have attempted various techniques to render this, but I can't find a way to have both series drawn on the same timescale, linked with the same range selector.
In case it helps, here's a starting point on JSFiddle, with all the unnecessary code removed: http://jsfiddle.net/g105b/8JhXv/
and a link to the original demo: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/demo/candlestick-and-volume/
Answer taken from official Highcharts forum
it is possible, but with some limitations. In the fact you want to show gantt chart. Bar charts aren't possible in your case - bar chart = inverted whole chart (yAxis becames xAxis, etc). Instead take a look at example for gantt chart: http://jsfiddle.net/highcharts/r6emu/
You can combine them into one, ane effect: http://jsfiddle.net/8JhXv/1/
About limits:
tooltip fo bottom chart is availabe only when you mouseover start and end date
bars are on lines, not between them