I have a echarts bar graph with series of data. When a bar is clicked, emphasis is applied on it. Is there a way to programmatically select one of the series in the bar-graph to apply emphasis on when the graph loads?
The options code I have for the bar graph:
options = {
markPoint: { data: ['Q1'] },
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['Q1', 'Q2', 'Q3', 'Q4'],
axisTick: {
alignWithLabel: true,
}
}
],
yAxis: [{
type: 'value'
}],
series: [{
name: 'Counters',
type: 'bar',
barWidth: '50%',
data: [3,8,12,5],
itemStyle: {
//highlight
emphasis: {
barBorderColor: 'red',
barBorderWidth: 2
}
}
}]
};
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…