uber/react-vis

Allow Labels to be on the 'outside' of the chart, allow subLabels to be styled

Open

#887 opened on Jul 23, 2018

View on GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (8,615 stars) (868 forks)batch import
extended serieshelp wanted

Description

I have been having a problem rendering labels for my RadialChart and have broken it down to 2 root causes, both of which I'm happy to submit a PR for if they make sense, or to split into separate issues for discussion.

Context: I'm attempting to position labels cleanly outside the rendered chart entirely.

From testing around with the generated chart, the way to best position labels is to invert the checks for the textAnchor and alignmentBaseline values in LabelSeries so that the labels are positioned outside the chart completely, but consistently spaced.

The second issue I'm having is that we want to be able to style the sub label (specifically, significantly increase the font size) and to do that right now, I'm resorting to external css and a translate css transform.

It seems like the first problem could be solved with a new boolean prop for label series, also exposed in RadialChart as labelsOutside (not sure of a good prop name in the label series). The second would be to allow subLabelsStyle to be a prop similar to labelsStyle.

Contributor guide