Hi John,

This code doesn't seem to be familiar to me. Can you provide the complete
demo or with an online link?

Thanks

*Ovilia*


On Wed, Aug 30, 2023 at 9:20 AM John Hill <john.h...@oasisdigital.com>
wrote:

> in the following code is there a way to stop the text from overflowing the
> Rect?
>
> const rectNormal = clipRectByRect(params, {
> x: x,
> y: y,
> width: barLength,
> height: barHeight,
> z: type === 'ja-rollout' || type === 'marker-column' ? 99 : 1,
> });
> const rectVIP = clipRectByRect(params, {
> x: x,
> y: y,
> width: barLength / 2,
> height: barHeight,
> });
> const rectText = clipRectByRect(params, {
> x: x,
> y: y,
> width: barLength,
> height: barHeight,
> });
> return {
> type: 'group',
> children: [
> {
> type: 'rect',
> ignore: !rectNormal,
> shape: rectNormal,
> style: api.style({
> fill: color ? color : '#008d6c',
> }),
> },
> {
> type: 'rect',
> ignore: !rectVIP && !api.value(4),
> shape: rectVIP,
> style: api.style({
> fill: color ? color : '#008d6c',
> }),
> },
> {
> type: 'rect',
> name: 'mainBar',
> ignore: !rectText,
> shape: rectText,
> overflow: 'truncate',
> style: api.style({
> fill: 'transparent',
> stroke: 'transparent',
> text: showText ? text : '',
> overflow: 'truncate',
> textFill: '#fff',
> }),
> },
> ],
> };
>

Reply via email to