7.1.2 • Published 10 months ago

d3-responsive-barchart v7.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

D3 RESPONSIVE BAR CHART

D3 Responsive Bar Chart rendering for reusability purpose.

Installation

  npm install d3-responsive-barchart

Dependencies

  npm install d3

Options/Config

Following options are available:

NameTypeDescription
datadata: [{"x": "Bosnia and Herzegovina","y": 20,"units": "%"},
{"x": "India","y": 78,"units": "%"},{"x": "China","y": 64,"units": "%"}]Data for bar chart
marginObject { left: 10, top: 10, right: 10, bottom: 50 }Specify margin
widthStringWidth for SVG
heightStringheight for SVG

Usage/Examples

HTML

<div id="barChartPlaceholder" class=""></div>

JS

const config = {
          width: 363,
          height: 100,
          data: [
          {
            "x": "Bosnia and Herzegovina",
            "y": 20,
            "units": "%"
          },
          {
            "x": "India",
            "y": 78,
            "units": "%"
          },
          {
            "x": "China",
            "y": 64,
            "units": "%"
          }]
        };
renderBarChart("#barChartPlaceholder", config)
7.1.2

10 months ago

7.1.0

10 months ago

7.0.2

10 months ago