Hi Rakhesh,
Thanks
for using Syncfusion Products.
We have prepared a sample based on your requirement for drilldown chart using JSON data and you can find the sample below in the attachment.
Please
let us know if this helps.
Regards,
Akbar
Basha KM
Hi Rakhesh,
Thanks for the update.
We have created a simple sample to bind data from controller to Chart with drill down feature. The sample can be downloaded from the following link.
Please refer the following code snippet to achieve this.
<code>
[CS]
//Action method for populating chart data
public ActionResult GetData()
{
List<ChartData> result = new List<ChartData>();
Random r = new Random();
for (int i = 0; i < 3; i++)
result.Add(new ChartData() { XName = i, YName = r.Next(40, 60) });
return Json(result, JsonRequestBehavior.AllowGet);
}
//Class for storing chart data in list
public class ChartData
{
//A property for X-value of chart series
public double XName
{ get; set; }
//A property for Y-value of chart series
public double YName
{ get; set; }
}
[CSHTML]
@(Html.EJ().Chart("chart1").Series(
ser=>ser.Name("Market").Marker(m=>m.Visible(false).DataLabel(dt=>dt.Visible(true)))
.Type(SeriesType.Pie).XName("XName").YName("YName").Query("ej.Query()")
//binding data from controller to chart series
.DataSource(service=>service.URL(Url.Action("GetData", "ChartData"))).Add())
.PointRegionClick("onclick")
.Legend(leg=>leg.Visible(false))
.Size(sz=>sz.Width("600px").Height("600px"))
.Title(t1=>t1.Text("Average Sales Comparison")))
</code>
For more information about data binding and drill down, please refer our online documentation in the following link.
Remote Databinding: http://help.syncfusion.com/ug/js/documents/remotedata.htm
Drilldown: http://help.syncfusion.com/ug/js/documents/drilldown.htm
Our online sample for databinding and drill down can be found in the following link:
Databinding: http://mvc.syncfusion.com/demos/web/Chart/RemoteData
Drilldown: http://mvc.syncfusion.com/demos/web/Chart/DrillDown
Please let us know if you have any concern.
Regards,
Anand