!!!###!!!title=75-How to display the legend title and legend with left-right separation in the same row——VisActor/VChart FAQ documents!!!###!!!

How to display the legend title and legend with left-right separation in the same row?

Question Description

I would like to add some textual descriptions to a legend, expecting to create a legend and its corresponding text description at the bottom of the chart. The desired layout effect is to have the text left-aligned and the legend right-aligned, both in the same row. Is there any charting library that can accommodate this specific custom layout logic?

Solution

VChart provides the legend component and title component, both have absolute positioning layout mode. By setting layoutType: 'absolute', you can enable this layout mode. Next, you can set sufficient padding for the chart and place the title component in the bottom left corner, and the legend component in the bottom right corner. This will display them into left-right separation in the same row.

Code Example

Quote