1

how to get this data "{ 29.9, 71.5, 106.4}" from database???

DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
.InitChart(new Chart { Type = ChartTypes.Bar })
.SetTitle(new Title { Text = "Wind speed during two days" })
.SetLegend(new Legend { Enabled = false })
.SetXAxis(new XAxis{
Categories = new[] { "Jan", "Feb", "Mar" }
 }).SetSeries(new Series{
Data = new Data(new object[] { 29.9, 71.5, 106.4})
 });
ltrChart.Text = chart.ToHtmlString();
Chandan
  • 11
  • 2

1 Answers1

0

I use this code and its work.....

DataTable dt2 = new DataTable();
dt2 = Chart_BL.fetch_Chart_Data(1);

decimal[] ar1 = new decimal[dt2.Rows.Count];

for (int i = 0; i < dt2.Rows.Count; i++)
    {
      ar1[i] = Convert.ToDecimal(dt2.Rows[i]["age"].ToString());

    }

DotNet.Highcharts.Highcharts chart2 = new DotNet.Highcharts.Highcharts("chart_2")
               .InitChart(new Chart { Type = ChartTypes.Bar })
               .SetTitle(new Title { Text = "" })
               .SetLegend(new Legend { Enabled = true })
               .SetXAxis(new XAxis
               {
                   Categories = new String[] { "10th", "11th", "10th", "11th" }
               })
                .SetSeries(new Series
                {
                    Data = new Data(ar1.Select(x => (object)x).ToArray())

                });

enter image description here

Chandan
  • 11
  • 2