title: passing json values to highcharts from .net code behind
body: <pre><code>var Javascriptxvalue= $.parseJSON($("#hdnXaxis").val());
  var Javascriptyvalue= $.parseJSON($("#hdnYaxis").val());  
  
  $(document).ready(DrawMyGraph1);
        function DrawMyGraph1() {
  
         chart = new Highcharts.Chart(
         {
          chart: {
              type: 'column',
              renderTo: 'container3',
              defaultSeriesType: 'area'
  
          },
          title: {
              text: ''
          },
          subtitle: {
              text: ''
          },
          xAxis: {
              categories: Javascriptxvalue,
              labels: {
                  enabled: false
              }
          },
          yAxis: {
              title: {
                  text: 'No of Patients'
              }
          },
  
          credits: {
              enabled: false
          },
          tooltip: {
              formatter: function () {
                  return this.series.name + ' - ' + Highcharts.numberFormat(this.y, 0);
              }
          },
          series: Javascriptyvalue
      });
  
  }
  </code></pre>
  
  <p>c# code
   void FastMovingStocksBarChart(string date1, string date2, string selperiod, string sql)
      {
          DataSet dschart = new DataSet();
          dschart = _obj_MIS.DoctorpatientreportChart(date1, date2, selperiod,sql);
          List lstXaxis = new List();
          List lstcolors = new List();</p>
  
  <pre><code>    lstcolors.Add("#3366DD");
      //lstcolors.Add("#FFEE22");
      //lstcolors.Add("#33BBCC");
      lstcolors.Add("#CC0022");
      //lstcolors.Add("#FF0000");
      lstcolors.Add("#339900");
      lstcolors.Add("#FF7700");
      lstcolors.Add("#33BBCC");
      lstcolors.Add("#99EEEE");
      lstcolors.Add("#6699FF");
      lstcolors.Add("#9966BB");
      lstcolors.Add("#99BB66");
      lstcolors.Add("#FF7700");
      lstcolors.Add("#FFEE22");
      lstcolors.Add("#FFCBB9");
      lstcolors.Add("EAEC93");
      lstcolors.Add("D7FBE6");
      lstcolors.Add("FFCACA");
  
      for (int i = 0; i &lt; dschart.Tables[0].Rows.Count; i++)
      {
          lstXaxis.Add(dschart.Tables[0].Rows[i]["Doctor Name"].ToString());
  
      }
      List&lt;ChartEx&gt; lstseries = new List&lt;ChartEx&gt;();
      int count = 0;
      for (int i = 0; i &lt; dschart.Tables[0].Rows.Count; i++)
      {
  
          ChartEx oEx = new ChartEx();
          oEx.name = dschart.Tables[0].Rows[i]["Doctor Name"].ToString();
          //oEx.data.Add(Convert.ToInt32(dschart.Tables[0].Rows[i]["Patients"]));
          oEx.data = new List&lt;int&gt;() { Convert.ToInt32(dschart.Tables[0].Rows[i]["Patients"]) };
          oEx.color = lstcolors[count];
          lstseries.Add(oEx);
  
          count++;
          if (count &gt;= lstcolors.Count)
           count = 0; 
  
  
      }
      //Convert X axis data to JSON
      JavaScriptSerializer oSerializer1 = new JavaScriptSerializer();
      hdnXaxis.Value = oSerializer1.Serialize(lstXaxis);
  
  
  
  
      //Convert Y axis data to JSON
      JavaScriptSerializer oSerializer2 = new JavaScriptSerializer();
      hdnYaxis.Value = oSerializer1.Serialize(lstseries);
  </code></pre>
  
  <p>}</p>
  
  <p>I am not getting the values for "Javascriptxvalue" and "Javascriptyvalue"  inside the chart function  </p>
  
  <p>can anyone help me</p>
  
  <p>Regards
  Prabhu</p>