question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto Width no Longer Works in React

See original GitHub issue

Describe the bug Auto width no longer works in React… getting error To use auto layout, the width or height of the container must be specified as a value such as "%" or "vh", "vw" even though width is specified.

To Reproduce Steps to reproduce the behavior:

 const chartOptions = {
        chart: {
            height: 500,
            width: 'auto',
            title: 'Monthly Revenue',
            format: '1,000'
        },
        ...
}

...

<ColumnChart
    style={{ width: "100%" }}
    ref={chartRef}
    data={chartData}
    options={chartOptions}
/>

Expected behavior Expected to work as in documentation… should get a responsive chart.

Desktop (please complete the following information):

  • OS: all
  • Browser: all
  • Version: 4.1.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jung-hancommented, Feb 23, 2021

@tnoetzel I will release it today. When released, I will let you know by comment.

0reactions
pinakipatraprocommented, Apr 9, 2021

Hi Experts, I am using the @version 4.2.1 and is still able to reproduce the same issue in heatmap chart

const options = { chart: { title: ‘24-hr Average Temperature’, width: ‘auto’, height: ‘auto’ }, xAxis: { title: ‘Month’, }, yAxis: { title: ‘City’, }, tooltip: { formatter: (value) => ${value}°C, }, legend: { align: ‘bottom’, }, series: { dataLabels: { visible: true, }, }, exportMenu: { visible: false }, responsive: { animation: { duration: 300 } }

	};

	const chart = toastui.Chart.heatmapChart({ el, data, options });

Error :

toastui-chart.min.js:7 Uncaught Error: To use auto layout, the width or height of the container must be specified as a value such as “%” or “vh”, “vw”. at f.value (toastui-chart.min.js:7) at new e (toastui-chart.min.js:7) at f.<anonymous> (toastui-chart.min.js:7) at new f (toastui-chart.min.js:7) at Function.heatmapChart (toastui-chart.min.js:7)

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-native view auto width by text inside - Stack Overflow
By doing this everything inside is no longer using the flexbox layout but using text layout. <Text> <Text>{'Your text here'}</Text> </Text>.
Read more >
Auto width / set width to longest option width #4201 - GitHub
When using a standard html select element the width of the element get's automatically set to the width of the longest/biggest option. This...
Read more >
Height and Width - React Native
The general way to set the dimensions of a component is by adding a fixed width and height to style. All dimensions in...
Read more >
scrollbar-width - CSS: Cascading Style Sheets - MDN Web Docs
The scrollbar-width property allows the author to set the maximum thickness of an element's scrollbars when they are shown.
Read more >
Column Sizing - React Data Grid
Autosizing columns looks at the rendered cells on the screen, and works out the width based on what it sees. It cannot see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found