I am currently working on an Angular14 project that incorporates the Scatter3D plot functionality from the Apache Echarts library. However, I am facing challenges in customizing the tooltip information.
https://i.sstatic.net/0sDuI.png
Below is the code snippet relating to this feature:
const options = {
grid3D: {},
tooltip: {},
xAxis3D: {
name: 'Total(USD)',
nameTextStyle: {
fontSize: 10
},
type: 'value',
axisLabel: {
formatter: (value: any) => '$' + shortenNumber(value),
fontSize: 10
}
},
yAxis3D: {
name: 'Payout',
nameTextStyle: {
fontSize: 10
},
type: EchartsAxisType.Value,
axisLabel: {
formatter: (value: any) => '$' + shortenNumber(value),
fontSize: 10
}
},
zAxis3D: {
name: 'Ratio(%)',
nameTextStyle: {
fontSize: 10
},
type: EchartsAxisType.Value,
axisLabel: {
formatter: (value: any) => formatPercent(value / 100, 'en-US', '1.2-2'),
fontSize: 10
}
},
series: [
{
name: 'Analytics',
type: 'scatter3d',
symbolSize: 2,
data: plotdata,
dimensions: ['Total', 'Payout', 'Ratio']
}
]
};
The shortenNumber
function is used to convert long numbers into abbreviated formats.