Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am making an application in ASP.NET in C #.
I made a chart using Google Charts Line, whether by an array with 1000 values, this represents correctly.
If the array is 2500 for example, and does not show a failure alert.
Is there any limit on the size of the array or table.
Code:

C#
var _puntoDeMedicionId = $('#<%= DropDownPtoMedicionGraf.ClientID %>').val();
 var _EntradasSalidas = _ids;
 var _FechaHoraIni = $('#<%= TextBoxFechaIniGraf.ClientID %>').val(); //Fecha inicial de seleccion
 var _FechaHoraFin = $('#<%= TextBoxFechaFinGraf.ClientID %>').val(); //Fecha final de seleccion

 $.ajax({
     url: "Graficos.aspx/GetChartData",
     data: "{'pPuntoDeMedicionId':'" + _puntoDeMedicionId + "'," +
           " 'pEntradasSalidas' : '" + _EntradasSalidas + "'," +
           " 'pFechaHoraIni' : '" + _FechaHoraIni + "'," +
           " 'pFechaHoraFin' : '" + _FechaHoraFin + "'" +
     "}",
     dataType: "json",
     type: "POST",
     contentType: "application/json; chartset=utf-8",
     success: function (data) {
           var _primero = true;
            $(data.d).each(function (_index, _objeto) {
                if (_primero == true)
                    _primero = false;
                else
                       _objeto[0] = moment(_objeto[0]).toDate();


            });
         chartData = data.d;
     },
     failure: function (r) {
         alert(data.d);
     },
     error: function (data) {
       //  alert(data.d);
         alert("Error cargando los datos, demasiados datos a representar o conexion muy lenta");
     }
 }).done(function () {
     // after complete loading data



     google.setOnLoadCallback(drawChart);
     drawChart();

 });
Posted

1 solution

you have to increase your JSON MAX value from web.config
XML
<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="5000000"/>
      </webServices>
    </scripting>
  </system.web.extensions>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900