javascript - Aligning label below chartist chart -
i have page chart generated using chartist (https://gionkunz.github.io/chartist-js/)
below chart, there labels. because of length of labels, need rotate labels.
i've been able css:
.ct-chart .ct-label.ct-horizontal.ct-end { transform: translate(-15px, 15px) rotate(315deg); white-space: nowrap; }
i face issue: when labels long, part of them gets "chopped off".
i've created jsfiddle demonstrate issue: https://jsfiddle.net/ls5k2pr0/
the labels hidden because overflow svg
element, moved original point. update css this:
.ct-chart-bar { overflow: visible; margin : 0 0 30px 0; } .ct-chart .ct-label.ct-horizontal.ct-end { position: relative; justify-content: flex-end; text-align: right; transform-origin: 100% 0; transform: translate(-100%) rotate(-45deg); white-space:nowrap; }
here updated jsfiddle https://jsfiddle.net/ls5k2pr0/1/
Comments
Post a Comment