We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fc5b29 commit 474e77fCopy full SHA for 474e77f
src/components/Echarts/renderChart.js
@@ -2,9 +2,11 @@ import echarts from './echarts.min';
2
import toString from '../../util/toString';
3
4
export default function renderChart(props) {
5
- const height = props.height || 400;
+ const height = `${props.height || 400}px`;
6
+ const width = props.width ? `${props.width}px` : 'auto';
7
return `
- document.getElementById('main').style.height = "${height}px";
8
+ document.getElementById('main').style.height = "${height}";
9
+ document.getElementById('main').style.width = "${width}";
10
var myChart = echarts.init(document.getElementById('main'));
11
myChart.setOption(${toString(props.option)});
12
`
0 commit comments