import hbs from 'htmlbars-inline-precompile'; import EmberObject, { computed } from '@ember/object'; import { on } from '@ember/object/evented'; import DelayedTruth from '../utils/delayed-truth'; export default { title: 'Charts/Distribution Bar', }; export let Standard = () => { return { template: hbs`
The distribution bar chart proportionally show data in a single bar. It includes a tooltip out of the box, assumes the size of the container element, and is designed to be styled with CSS.
`, context: { delayedTruth: DelayedTruth.create(), distributionBarData: [ { label: 'one', value: 10 }, { label: 'two', value: 20 }, { label: 'three', value: 30 }, ], }, }; }; export let WithClasses = () => { return { template: hbs`If a datum provides a className
property, it will be assigned to the corresponding rect
element, allowing for custom colorization.
Distribution bar assumes the dimensions of the container.
`, context: { delayedTruth: DelayedTruth.create(), distributionBarData: [ { label: 'one', value: 10 }, { label: 'two', value: 20 }, { label: 'three', value: 30 }, ], }, }; }; export let LiveUpdating = () => { return { template: hbs`Distribution bar animates with data changes.
A variation of the Distribution Bar component for when the distribution bar is the central component of the page. It's a larger format that requires no interaction to see the data labels and values.
`, context: { delayedTruth: DelayedTruth.create(), distributionBarData: [ { label: 'one', value: 10 }, { label: 'two', value: 20 }, { label: 'three', value: 0 }, { label: 'four', value: 35 }, ], }, }; };