Open choutianxius opened 4 months ago
Enable the usage of custom category bar label texts, instead of just percentage values.
For example, the following component
<CategoryBar className='mt-4' values={[25, 25, 25, 25]} colors={['sky', 'lime', 'orange', 'rose']} markerValue={36} labels={[12.5, 15, 17.5, 20, 22.5]} // suppose this new property is added />
may display
Usage:
Where the type of labels could be specified with
type LabelType = null | string | number; // null indicates the label should always be omitted from displaying type LabelsType = LabelType[];
Also, the condition values.length === labels.length - 1 might be forced
values.length === labels.length - 1
What problem does this feature solve?
Enable the usage of custom category bar label texts, instead of just percentage values.
For example, the following component
may display
What does the proposed API look like?
Usage:
Where the type of labels could be specified with
Also, the condition
values.length === labels.length - 1
might be forced