我在我的 AngularJs 应用程序中使用 AmCharts,我想知道当我们将鼠标悬停在类别轴标签上时如何创建自定义气球文本。以下是我的代码:
var configChart = function () {
employeeChart = new AmCharts.AmSerialChart();
employeeChart.categoryField = "empId";
var yAxis = new AmCharts.ValueAxis();
yAxis.position = "left";
employeeChart.addValueAxis(yAxis);
mcfBarGraph = new AmCharts.AmGraph();
mcfBarGraph.valueField = "employeeRating";
mcfBarGraph.type = "column";
mcfBarGraph.fillAlphas = 1;
mcfBarGraph.lineColor = "#f0ab00";
mcfBarGraph.valueAxis = yAxis;
employeeChart.addGraph(empBarGraph);
employeeChart.write('employee');
}
在我的图表中,类别字段是 emp Id,而 valueField 是评级。此图表的数据提供者是员工 json 数据。现在 JSON 中还有一个属性,即位置。所以我想在图表上的类别轴字段上显示“Location-Emp ID”。
你能告诉我如何实现这个功能吗?