I am using amCharts in my AngularJS application and I am looking for a way to rename the label of the category field. Following is my code:
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');
}
In the above coode if you observe the categoryField is empId so on the x-axis it shows employee Id's, I want to make it "dept-empId". For example if the department number is 1, on the x-axis it show display 1-1,1-2 etc. The department Id is not in the data provider but is one of the scope variables in my controller. Could you let me know how I could achieve this.