layercake icon indicating copy to clipboard operation
layercake copied to clipboard

Add a prop to HTML Axis components to use pixels and not percentages

Open mhkeller opened this issue 1 year ago • 1 comments

Currently, the Axis components use percentages so they can be used in server-side charts. But you may want to use them also in normal charts that don't use percentRange if, for example, you want an easy to way to make a multi-line label in HTML.

All you have to do is change % to px and we could expose this a prop to make it easy for people.

mhkeller avatar May 17 '24 17:05 mhkeller

This could also be done dynamically looking at the percentRange prop at first:

export let units = $percentRange === true ? '%' : 'px';

mhkeller avatar May 17 '24 21:05 mhkeller

Done via https://github.com/mhkeller/layercake/pull/203

mhkeller avatar Jun 23 '24 16:06 mhkeller