Can be used in the same way a pie chart can be used. By default, Distribution Bar comparatively represents data without numbers. To add numbers to this chart, you can use the Legend kit with prefix text.
import React from 'react' import DistributionBar from 'playbook-ui' const DistributionBarDefault = (props) => { return ( <React.Fragment> <div> <DistributionBar widths={[1, 2, 3, 4, 5, 3, 3, 7]} /> </div> <br /> <br /> <div> <DistributionBar size="sm" widths={[1, 2, 3, 4, 5, 3, 3, 7]} /> </div> </React.Fragment> ) } export default DistributionBarDefault
You can customize the order of the colors you would like to use by using the colors
prop. Only the data and status colors will work for Playbook charts. See the design page for reference.
import React from 'react' import DistributionBar from 'playbook-ui' const DistributionBarCustomColors = (props) => { return ( <React.Fragment> <div> <DistributionBar colors={['data_7', 'data_1', 'neutral']} widths={[4, 5, 3]} /> </div> </React.Fragment> ) } export default DistributionBarCustomColors