y-takey / chartjs-plugin-stacked100

This plugin for Chart.js that makes your bar chart to 100% stacked bar chart.
MIT License
129 stars 29 forks source link

staked100 is not working as expected when component re-rendered. #105

Open dhineshdhanapal opened 7 months ago

dhineshdhanapal commented 7 months ago

@y-takey I am using react-chartjs-2 and chartjs-plugin-stacked100 in react single page components. when I use stacked bar chart, when the component got re-rendered, stacked bars are not as same as with full width on initial render.

image

when the component re-rendered, it is changed as follows.

image

I am using as follows: ChartJS.register(ChartjsPluginStacked100) <Bar height="35px" data= {data} options={{ indexAxis: 'y', responsive: false, maintainAspectRatio: false, scales: { x: { display: false, grid: { display: false, }, stacked: true, }, y: { display: false, title: "yaxis", grid: { display: false, }, stacked: true, }, }, plugins: { legend: { display: false, }, tooltip: { enabled: false, }, stacked100: { enable: true }, }, }} />

y-takey commented 6 months ago

Hi @dhineshdhanapal , I appreciate your report. To better understand and address the issue, could you please provide a repository that reproduces the problem?