1.0.7 • Published 8 years ago

d-grouped-barchart v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

d-grouped-barchart

Derby grouped bar chart component using d3 and d3-tip.

NPM

Features

  • Grouping key as a setting
  • Negative values
  • Custom on click and on hover tooltips
  • Legend based on the grouping key
  • Title and subtitles parameters
  • Fullscreen mode on double click
  • Legend and colors customization
  • Setting space between bars

Usage

Install

npm install d-grouped-barchart

Add component into derby application

app.component require('d-grouped-barchart')

Styles

@import '/node_modules/d-grouped-barchart/styles/index.styl'

Data format

data = [
  {
    "role": "Vet",
    "Pre": 3.7857142857,
    "Post": 4.2857142857
  },
  {
    "role": "Engineer",
    "Pre": -4.7142857143,
    "Post": 4.2142857143
  },
  {
    "role": "Mother",
    "Pre": 5.7142857143,
    "Post": 4.7857142857
  }
  ...
]

Within template

view(name='d-grouped-barchart', data='{{_page.data}}', groupByKey='role', width='500', height='200')

Additional parameters to the component

  • colors - array, defines color of each bar in group, e.g. '#4f81bd', '#c0504d'
  • axisHeaders - array, defines x and y axis header respectively, e.g. "Groups", "Value"
  • header - string, sets a text on top of the chart
  • subheader - string, defines a text below the header
  • tipContentClick - callback, returns a string html contents which will be displayed in an onclick tooltip. The tooltips won't work unless the parameter is specified.
  • tipContentHover - callback, returns a string html contents displayed as an onhover tooltip
  • innerPadding - space between bars within a group
  • outerPadding - space between groups of bars
  • xRange - override X scale's range

Gallery

Alt text Alt text

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.9.5

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.2

8 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.18

9 years ago

0.3.17

9 years ago

0.3.16

9 years ago

0.3.15

9 years ago

0.3.14

9 years ago

0.3.13

9 years ago

0.3.12

9 years ago

0.3.11

9 years ago

0.3.10

9 years ago

0.3.9

9 years ago

0.3.8

9 years ago

0.3.7

9 years ago

0.3.6

9 years ago

0.3.5

9 years ago

0.3.4

9 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.14

10 years ago

0.2.13

10 years ago

0.2.12

10 years ago

0.2.11

10 years ago

0.2.10

10 years ago

0.2.9

10 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago