I have created a chart in asp.net mvc project.. Controller looks like:
public ActionResult ApplicationPieChart()
{
var _context = new chart();
ArrayList xValue = new ArrayList();
ArrayList yValue = new ArrayList();
var a = (from c in _context.vw_AppType select c);
var b = a.GroupBy(x => x.ApplicationName, (k, cnt) => new { ApplicationName = k, cnt = cnt.Count() });
b.ToList().ForEach(rs => xValue.Add(rs.ApplicationName));
b.ToList().ForEach(rs => yValue.Add(rs.cnt));
new Chart(width: 500, height: 300, theme: ChartTheme.Blue)
.AddTitle("Count Of Application")
.AddSeries("Default",chartArea:null, chartType: "pie", xValue: xValue, yValues: yValue)
.AddLegend()
.Write("bmp");
return null;
}
and the view part is:
<table>
<tr>
<td>
<img src="@Url.Action("ApplicationPieChart")" />
</td>
</tr>
</table>
I got the chart now I need to implement drill down functionality in my chart and i need to show the values and percentage in the chart.. How can I achieve them.