The Bar
component is available in the nivo
HTTP rendering API.
The API generates a SVG and return a path to this SVG
which can then be easily embedded.
The api accepts almost the same properties as the regular component, in json, however it's not interactive and you cannot use code in properties (functions).
Please note that the demo API server is installed on heroku using a free plan, so it might be unavailable from times to times.
no response available
Chart data.
'id'
Key to use to index the data.
'value'
]Keys to use to determine each serie.
'stacked'
How to group bars.
'vertical'
How to display bars.
value scale configuration.
index scale configuration.
false
Reverse bars, starts on top instead of bottom for vertical layout and right instead of left for horizontal one.
'auto'
Minimum value.
'auto'
Maximum value.
Optional formatter for values.
0.1
Padding between each bar (ratio).
0
Padding between grouped/stacked bars.
Chart width.
Chart height.
'Depends on device'
Adjust pixel ratio, useful for HiDPI screens.
Chart margin.
Define style for common elements such as labels, axes…
Define chart's colors.
'id'
Property used to determine node color.
0
Rectangle border radius.
0
Width of bar border.
Method to compute border color.
Define patterns and gradients.
Define rules to apply patterns and gradients
'grid'
, 'axes'
, 'bars'
, 'totals'
, 'markers'
, 'legends'
, 'annotations'
]Defines the order of layers.
true
Enable/disable labels.
'formattedValue'
Define how bar labels are computed.
0
Skip label if bar width is lower than provided value, ignored if 0.
0
Skip label if bar height is lower than provided value, ignored if 0.
Defines how to compute label text color.
'center'
Defines the position of the label relative to its bar.
0
Defines the vertical or horizontal (depends on layout) offset of the label.
false
Enable/disable totals labels.
10
Offset from the bar edge for the total label.
false
Enable/disable x grid.
Specify values to use for vertical grid lines.
true
Enable/disable y grid.
Specify values to use for horizontal grid lines.
Top axis configuration.
Right axis configuration.
Bottom axis configuration.
Left axis configuration.
true
Enable/disable interactivity.
Tooltip custom component
Showcase custom tooltip component.
onClick handler
Optional chart's legends.
true
Enable/disable transitions.
'default'
Motion config for react-spring, either a preset or a custom configuration.
Make the root SVG element and each bar item focusable, for keyboard navigation.
Main element role attribute.