picasso.js icon indicating copy to clipboard operation
picasso.js copied to clipboard

Add a new setting on the Axis labels that allow them to be aligned along the cross-axis

Open cbt1 opened this issue 6 years ago • 0 comments

Description

Currently the axis only allow labels to be aligned along the main-axis. To support other kinds of scenarios (for example a population pyramid with an axis in the center) you have to be able to align labels along the cross-axis as well.

Example solution

Add a new property called justify that takes a number from 0-1. Where 0 is always the point closes to the center area.

For an axis docked vertically, where the main-axis is along the y-axis, justify should move the labels along the x-axis in the label context (that is the bounding box all labels).

On an axis docked horizontally, where the main-axis is along the x-axis, justify should move the labels along the y-axis in the label container (that is the bounding box all labels).

If the preferredSize is overridden in the component definition. Any left over space from the start of the labels to the end of the component container, excluding paddingEnd and paddingStart, should be included in the label container.

cbt1 avatar Mar 07 '18 15:03 cbt1