Posts

Showing posts with the label Responsive

Responsive Charts with D3 with json parsing

Image
I was using chart of D3 but the chart were not responsive and also with csv. I found a article on eyeseast.github.io and i modified the article according to my need to make D3 chart responsive and work with JSON value. I passed JSON value into the Code and made some easy change. I really want to thanks eyeseast.github.io to great article of Responsive Charts with D3 but the article was not fulfilling my requirement for JSON parsing. That article use a csv file for data and some 4 column data to represent the Graph which was so difficult to understand and edit. I decided to make it more easy for  D3 chart with json parsing. Here is an example: Just copy and paste this code into a html file and run.  <style type="text/css">  /* Start css for D3 Graph for twitter Index */ div#chart{   max-width: 800px;   width: auto; } .bar rect {     stroke: #fff;     shape-rendering: crispEdges; } .bar rect.background {     fill: #E7E7E7; } .bar rect.percent {