How do I create and label subcategories within a category using ReactEcharts?

82 Views Asked by At

ReactEcharts. How to create and label subcategories within a category like in the screenshot. entrance 1-5 - data sources. entered and exit - source metrics.

Example data: [ { name: 'entered', value: 40, time: 09:00, source: 'entrance 1' }, { name: 'exit', value: 60, time: 09:00, source: 'entrance 1' }, ... ] enter image description here

P.S. Interested only in the creation of similar sub-categories in a category with a caption from below for the entire group.

1

There are 1 best solutions below

0
Matthias Mertens On

I am not exactly sure what your use case is. If you have a series for each "main" category and want them colored according to sub categories you can use visual map categories:

visualmap: {
    type: 'piecewise',
    dimension: 3,
    categories: ['entrance 1', 'entrance 2', 'entrance 3', 'entrance 4', 'entrance 5'],
}

If you have one series for each of your sub categories and strange axis labels (like in the given image) use multiple axis and format your axis labels according to your needs.