When attempting to display an ECharts component after the page has finished rendering, the canvas may fail to render.
Code example:
<div>
{dataType === DataTypeEnum.TABLE ? (
<div>
<Table columns={columns} dataSource={dataSource} loading={loading} />
</div>
) : (
<ReactEcharts
option={option}
style={{ height: 298 }}
/>
)}
</div>
When updating dataType to display the ECharts component, the chart does not appear. Inspecting the element in DevTools reveals that no corresponding canvas node exists in the DOM.
When attempting to display an ECharts component after the page has finished rendering, the canvas may fail to render.
Code example:
When updating
dataTypeto display the ECharts component, the chart does not appear. Inspecting the element in DevTools reveals that no corresponding canvas node exists in the DOM.