Adyen / lume

Lume is a component library for visual representations of data, built for Vue with D3.
https://lumedataviz.com
MIT License
43 stars 2 forks source link

xScale/yScale properties on the Stacked Bar Chart has no effect #374

Closed bponomarenko closed 9 months ago

bponomarenko commented 9 months ago

Problem description

Accordingly to the Stacked Bar Chart documentation, it is possible to specify custom values for the xScale and yScale properties. I tried to use those properties do define some fixed values over the y axis in a situation when there are no data values yet. However setting those properties doesn't seem to have any effect on the chart behavior. Even when there is data in the chart.

Used library version is 1.6.5.

Reproduction URL

No response

Reproduction steps

  1. Try to render Stacked Bar Chart vue component with the following set of properties:

    <lume-stacked-bar-chart
    :labels="['1', '2', '3']"
    :data="[{ label: 'Group 1', values: [1, 2, 3] }]"
    :y-scale="yScale"
    />

    where yScale is:

    import { scaleLinear } from 'd3';
    const yScale = (data, labels, size) => {
    console.log('custom yScale');
    return scaleLinear().domain([0, 100]).range([0, size.height]);
    };

    I guess, this might be happening because Stacked Bar Chart sets explicit xScale/yScale properties on the internal Lume Chart component that take precedence over externally provided properties.

Expected behavior

Upon rendering, I would expect to have y axis rendered for 0 - 100 domain range and to see "custom yScale" message printed in the browser console.

Screenshots

No response

Logs

No response

Browsers

No response

OS

No response

Validations