我有一个带有图例的饼图。我想将图例中的文本编辑并重命名为“部门A”,“部门B”,“部门C”
注意:我正在使用System.Web.Helpers
代码
public ActionResult MostComplained()
{
var deptA = _context.Tickets.Where(c => c.ConcernedDept ==“部门A”)。Count(c => c.TypeOfTicket ==“投诉”);
var deptB = _context.Tickets.Where(c => c.ConcernedDept ==“部门B”)。Count(c => c.TypeOfTicket ==“投诉”);
var deptC = _context.Tickets.Where(c => c.ConcernedDept ==“部门C”)。Count(c => c.TypeOfTicket ==“投诉”);
新Chart(宽度:500,高度:300,主题:ChartTheme.Green).AddSeries(图表类型:“ pie”, axisLabel:“#PERCENT {P2}”,
xValue:new [] {deptA,deptB,deptC},
yValues:new [] {deptA,deptB,deptC})。AddLegend()。Write(“ png”);
返回null;
}