I have a JSON data of this format:
[{"key":"A","values":187},{"key":"B","values":110}]
Can any ne help me to plot a bar chart using nvd3?
There are lots of examples on the Internet...
Here is just one: http://nvd3.org/examples/discreteBar.html
And another one: http://nvd3.org/examples/multiBarHorizontal.html
You can take the source code from there, and add your data instead of the example data there.
Hope this helps you...
Related
We're trying to convert our cfcharts to use ZingChart JSON styling, as we'd like to upgrade to CF11 which wrecked all our charts.
I'm currently trying to set up the legend for a bar chart. Previously we were using this xml styling code in the cfchart to include the label and the total for each bar in the legend:
<legend><![CDATA[$(rowlabel) Total:$(colTotal)]]></legend>
In my example, the bars represent years, so an example of a legend item would be "2013 Total:34".
How can I accomplish this using ZingCharts? My legend code so far looks something like this:
"legend":{
"backgroundColor":"#bdc3c7",
"alpha":1,
"borderWidth":0,
"shadow":false,
"borderRadius":10,
"header":{
"text":"Years",
"borderRadius":10
}
}
The legend text actually comes from the text attribute in the series object.
To get the total value of your series, you can use the %psum token. Here's a live demo using the legend code you provided. Right-click and select "View Source" to see the JSON.
There are quite a few tokens at your disposal, and you can even make your own.
I'm on the ZingChart team and we're here to help if you have any additional questions while converting your charts!
I have about 500 XY points which I would like represent as line using DHTMLXChart. Apparently the only suitable chart (scatter) do not allowing to do it. Any idea how to solve this issue?
There is no native way to do this.
You could use line chart with markers:
Example
Ok on that confirmation you're not bound to a DHTMLX, I would go with Google Charts it's based on opinion, but more importantly on functionality.
The Google Charts API is very easy to work with as it takes raw Javascript data and applies it to the chart and that data may be shoved into multidimensional arrays or as I prefer, JSON Data.
Additionally the Google Charts API has what you are after which is located at https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart or alternatively...
https://developers.google.com/chart/interactive/docs/gallery/scatterchart
P.S. It may be a hefty documentation to read, but learning Google Charts API pays dividends and this would Replace DHTMLX instead of being an additional plugin.
Hope that helps.
i'm just newbie in data visualization, but i must try to visualize for some data
i find the combo-multi-axes with highchart.js (http://www.highcharts.com/demo/combo-multi-axes), it's look perfect to me, but i want make it using d3.js, and i try search referrence for how d3.js can build it, but stil not found
How d3.js can build same like http://www.highcharts.com/demo/combo-multi-axes ?
http://www.evolutionoftheweb.com/
Question is:
What type of chart plugin they used in JavaScript like jqplot, float plugin?
If not, then how did they make it? is it just image or canvas?
If you look at the page source you will find that all the logic is in the /js/all.js file. If you search this you can find things like: jquery, d3, and other libraries. It seems that majority of work is done with d3.
I would like to display on a webpage a heatmap (matrix) that I generate in R.
The matrix I have looks like this, but in my case the size is 300x300.
Basically I am looking for an interactive clustering, which would look like this :
http://online.wsj.com/article/SB125993225142676615.html#articleTabs%3Dinteractive
http://mbostock.github.com/protovis/ex/matrix.html
I would like to be able to clic on a branch which would then highlight the selected group/text, and fade out the rest of the matrix.
I have had a look around and cannot find much. I don't even know what language I should use for this ? JSON, Flash, HTML5, javascript, google charts ?
Any comments and advices would be extremely appreciated here.
Thanks.
I think that InCHlib - Interactive Cluster Heatmap library could be the solution.
Available from http://openscreen.cz/software/inchlib.
Google Visualization provides this heatmap option:
http://informatics.systemsbiology.net/visualizations/heatmap/bioheatmap.html
There's also this project that adapted it for more advanced uses and actually includes mouse-overs and tool-tips, as well as line magnification:
http://code.google.com/p/visquick/
You may also want to take a look at jQuery Flot, but be warned that WSJ uses a super expensive company called Tableau for data visualization and you are unlikely to find that level of visualization eye candy in an open source or free to use package.
Unfortunately, I had the same requirement. To create a Clustergram (Heatmap + Dendrogram) for a hierarchical clustering results.
There is no direct solution for this. I used ProtovisGWT (Choosel) to create dendrogram and heatmap seperatley and later combnied them.
If you just want js library you can use just protovis or d3.js to achieve this.
I would recommend using JavaScript for this task. Save your heatmap as SVG in R
svg("mymap.svg")
heatmap(...)
dev.off()
And then embed it into an HTML document as object
<object id="test-svg" width="800" height="600"
type="image/svg+xml" data="test.svg"></object>
Now, you can use JavaScript or ECMAScript to do all kinds of manipulations. I recommend to read one of the various online tutorials on this topic. E.g., you could get started with this one: http://www.petercollingridge.co.uk/data-visualisation/using-javascript-control-svg
Treemap of D3.js solves this beautifully. See here
http://mbostock.github.io/d3/talk/20111018/treemap.html
You could try http://amp.pharm.mssm.edu/clustergrammer/ . It is not written in R, but you can make an interactive clustergram by uploading a matrix file in tab-separated format and you will be returned an interactive (reorderable, searchable, filterable, etc) and shareable web-based visualization
D3heatmap provides interactive heatmaps with dendrograms in R based on the heatmap and heatmap.2 interfaces. It includes single row and column selection but does not currently allow selection of dendrogram branches.