timelines-chart
timelines-chart copied to clipboard
"Fill" option for chart sizing
Hi,
Currently the only lever for controlling chart size is with absolute value-- ideally, to make sure the chart can reactively fill the window size, you should allow percentages as values.
@jusunglee thanks for reaching out.
This responsive functionality is beyond the scope of this library, but you can easily use a 3rd party module to monitor window resize events and inject a width property into timelines-chart.
For example, if you would use element-resize-detector to pick one, you would just need to do something like:
const myChart = TimelinesChart()
(document.getElementById('chart'));
elementResizeDetectorMaker().listenTo(
document.getElementById('chart'),
el => myChart.width(el.offsetWidth)
);