0

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.

  • Please add some more code of what you already tried to achieve your desired behaviour. Also a more detailed description of what youre in search of would be helpful to answer your question. – Fabian S. Apr 05 '17 at 14:25
  • this code is giving me a simple pie chart, but I am not able to add any values or percentage with chart – Deepshikha Sharma Apr 06 '17 at 07:04

0 Answers0