{
const container = html`<div style="width:${width + 'px'};height:${height + 'px'}"></div>`;
const chart = echarts.init(container);
const option = {
xAxis: {
type: 'category',
data: data.map(datum => datum.browser),
axisLabel: {
interval: 0,
}
},
tooltip: {},
yAxis: {
type: 'value'
},
series: [{
data: data.map(datum => datum.percent),
type: 'bar',
color: 'steelblue',
label: {
show: true,
position: 'top',
formatter: '{c}%',
}
}]
};
chart.setOption(option);
return container;
}