Good afternoon
Tell me how to add a link transition when clicking on an element in the echarts visualizer?
I found a function in the documentation:
myChart.on(‘click’, function(params) {
window.open(
‘Google’ + encodeURIComponent(params.name)
);
});
but fails to replicate it on a regular pie chart (pie) when using return {…} in Grafana.
// sample code pie chart
return {
title: {
text: ‘Referer of a Website’,
subtext: ‘Fake Data’,
left: ‘center’
},
tooltip: {
trigger: ‘item’
},
legend: {
orient: ‘vertical’,
left: ‘left’
},
series: [
{
name: ‘Access From’,
type: ‘pie’,
radius: ‘50%’,
data: [
{ value: 1048, name: ‘Search Engine’ },
{ value: 735, name: ‘Direct’ },
{ value: 580, name: ‘Email’ },
{ value: 484, name: ‘Union Ads’ },
{ value: 300, name: ‘Video Ads’ }
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: ‘rgba(0, 0, 0, 0.5)’
}
}
}
]
};
// sample code documentation:
myChart.on(‘click’, function(params) {
window.open(
‘Google’ + encodeURIComponent(params.name)
);
});