title: ej chart syncfusion access chart properties in controller c#
body: <p>I have a grid and a chart. I need to export the grid (working now) into excel but include the chart as well. </p>
  
  <p>so I use the grid export excel method and pass the chart (along with other params) as data like this:</p>
  
  <p>var data = {
                      "ClientID":  $scope.Model.ClientID,
                     ....
                      "Chart": JSON.stringify($("#MyChart").ejChart("instance"), getCircularReplacer()) 
                  };</p>
  
  <pre><code>  var grid = $("#" + table).ejGrid("instance");
      grid.export(url);
  </code></pre>
  
  <p>and It is passed to controller as string so I can convert it to chartproperties</p>
  
  <pre><code>[System.Web.Http.ActionName("ExcelExport")]
          [HttpPost]
          public ActionResult ExportToExcel()
          {
  string EJChart = _dictParams["Chart"].ToString();
  
  ChartProperties cprop = MyGridHelper.ConvertChartObject(EJChart);
  }
  </code></pre>
  
  <p>code for convertchart object which I took from <a href="https://help.syncfusion.com/js/chart/exporting" rel="nofollow noreferrer">here</a>: </p>
  
  <p>After conversion, when I try to look for the series, legends, points which I needed to draw my chart in c#, all have no values. It seems it's not getting it using that converter.</p>
  
  <p>so dig around a bit and see that those are inside model (one of the items in json EJChart) but it keeps saying cannot convert null, so I added null handler which it skips the item which made it even more null for values.</p>
  
  <p>Bottomline:
  How can I get the properties and values of the chart using c# from js controller but using grid export and not chart export? The sample code assumes that the export will be ejchart, but I am trying to export ejgrid along with the chart so I had to pass it as data params.</p>
  
  <p>why is the converter not working in getting the values, but I can see it in the json passed as param which look like this:</p>
  
  <pre><code>{"dragSettings":{"enable":false,"type":"xy"},"type":"column","splitMode":"value","splitValue":null,"splineType":"natural","cardinalSplineTension":0.5,"gapWidth":50,"pieOfPieCoefficient":0.6,"visibleOnLegend":"visible","enableAnimation":false,"animationDuration":null,"animationType":"linear","isClosed":true,"isTransposed":false,"isStacking":false,"columnWidth":0.7,"columnSpacing":0,"columnFacet":"rectangle","drawType":"line","doughnutCoefficient":0.4,"explodeOffset":25,"pyramidMode":"linear","boxPlotMode":"exclusive","funnelWidth":"11.6%","funnelHeight":"32.7%","positiveFill":null,"showMedian":true,"outlierSettings":{"shape":"circle","size":{"width":6,"height":6}},"cornerRadius":{"topLeft":0,"topRight":0,"bottomLeft":0,"bottomRight":0},"connectorLine":{"width":1,"opacity":1,"dashArray":null,"color":"#565656"},"errorBar":{"visibility":"hidden","mode":"vertical","type":"fixedValue","horizontalErrorValue":1,"verticalErrorValue":3,"horizontalPositiveErrorValue":1,"horizontalNegativeErrorValue":1,"verticalPositiveErrorValue":5,"verticalNegativeErrorValue":5,"direction":"both","cap":{"visible":true,"width":1,"length":20,"fill":"#000000"},"width":1,"opacity":1,"fill":"#000000"}
  </code></pre>
  
  <p>also, upon debugging, I saw the series, points etc are inside model in EJChart.</p>