0

Would you like some help I am not able to leave the format to be able to generate a graph using highchart,

Do the following query in the database:

var query = (from ir in db.IRR1235
                                 where ir.cod_levantamento_id == idCodLev
                                 select ir);


                    foreach (var item in query)
                    {
                        object[] values = new object[2];
                        values[0] = Convert.ToDecimal(item.inicial);
                        values[1] = Convert.ToDecimal(item.ir);
                        dataResult.Add(values);


                    }

return the result to json

 return Json(data, JsonRequestBehavior.AllowGet);

But the graph is just like this,

enter image description here

tereško
  • 58,060
  • 25
  • 98
  • 150
rysahara
  • 346
  • 1
  • 6
  • 23

1 Answers1

1

You don't show us how you are calling Highcharts (and in the future, please provide enough code to reproduce your problem), but looking at what you've given us, your JSON would produce something like this:

var jsonData = [[0,0],[1,10],[2,20],[3,30],[4,40],[5,50],[6,60],[7,70],[8,80],[9,90]];

If you called Highcharts like this:

$('#container').highcharts({
    series: jsonData
});

It would produce a broken plot like you show in your image.

If you called highcharts like this though:

    $('#container').highcharts({
        series: [{data: jsonData}]
    });

You'd get a single data series plotted correctly.

Mark
  • 106,305
  • 20
  • 172
  • 230
  • @Mark: Please help me on my [question here](http://stackoverflow.com/questions/27983248/need-help-in-plotting-a-chart-using-highcharts-in-angularjs) – AabinGunz Jan 17 '15 at 19:07