jQuery UI Widgets › Forums › Chart › Max number of datas
Tagged: chart, jquery chart
This topic contains 12 replies, has 2 voices, and was last updated by SylvainD 11 years, 9 months ago.
-
AuthorMax number of datas Posts
-
Hi,
What is the maximum number of points that can be showed in a line chart ?
My problem is the following : by default, I show 10 values but the user can increase this value. If I try something like 500 values to show, I get an error message :
uncaught TypeError : cannot read property ‘Value’ of undefined
My json result is good ! Then I can’t to anything more, even for 10 values, I got the error mesage.
I need to reload the page to make it works again. Then I try 500 values, and it works.The number of values change between to reload on the page (last try, 600 was good but not 700). Is it a memory problem issue, after some tries ?
Thanks
SylvainHi Sylvain,
There are no such restrictions. Could you please post and example which demonstrates your scenario?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI can give you a like to my dev platform .. but in private.
Or I can try to post you the necessary code, here.
Sylvain
Hi Sylvain,
What we need is a small sample which demonstrates your application scenario. It is not necessary to be with real data. It just have to reproduce the reported behavior i.e something which we will be able to debug locally.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comOk. I’ll do it as soon as possible and come back to you.
Hi,
you can find a piece of demo there : http://188.165.111.90:8080/Demos/TestGraph.html
Just enter the number of values you would like to see (over 500, it doesn’t work anymore).
Code of the page below :
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script src="../Scripts/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../Scripts/modernizr-1.7.min.js" type="text/javascript"></script> <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js" type="text/javascript"></script> <script src="../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script> <script src="../Scripts/jquery.validate.min.js" type="text/javascript"></script> <script src="../Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script> <!-- THEME --> <link href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="../Content/JqWidget/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../Scripts/JqWidget/jqxcore.js"></script> <script type="text/javascript" src="../Scripts/JqWidget/jqxchart.js"></script> <script type="text/javascript" src="../Scripts/JqWidget/jqxdata.js"></script> <script type="text/javascript" src="../Scripts/JqWidget/jqxgauge.js"></script></head><body> <div style="vertical-align: central"> Enter number of values <input id="inputCounter" type="text" placeholder="nombres" style="vertical-align: central; width: 50px; margin-left:10px" /> </div> <button id="buttonCounter" style="margin-left: 15px; vertical-align: central" class="btn btn-small btn-inverse span2" type="button" onclick="javascript:activeCounter()">Go</button> <div id="chartIntensity" style="height:500px;width:100%"></div> <script> function activeCounter() { var value = document.getElementById('inputCounter').value; console.log('Value : ' + value); energyIntensityGraph('http://noolibee.noolitic.biz/Plugins/plugins/GetIntensityLastValues?id=9daa3a45-b801-4756-b264-704e059f5ef2&last=' + value); } function energyIntensityGraph(url) { var dataSource = { datatype: "json", datafields: [{ name: 'Date' }, { name: 'Value', type: 'number' }], id: 'Date', data: { id: '9daa3a45-b801-4756-b264-704e059f5ef2' }, url: url }; var dataAdapter = new $.jqx.dataAdapter(dataSource, { autoBind: false, async: false, downloadComplete: function () { }, loadComplete: function (data) { if (data.Success == "False") { alert(data.Message); objectCount = -1; } }, loadError: function () { console.log('Error in Json Intensity'); } }); var settings = { title: 'Test', description: "", source: dataAdapter, colorScheme: 'scheme02', showLegend: false, categoryAxis: { displayValueAxis: true, dataField: 'Date', axisSize: 'auto', showGridLines: false }, seriesGroups: [{ type: 'line', // change the series type here valueAxis: { axisSize: 'auto', description: 'Value' }, series: [{ dataField: 'Value', displayText: 'value' }] }] }; $('#chartIntensity').jqxChart(settings); } </script></body></html> Thanks Sylvain
Hi Sylvain,
I don’t see a setting for the Chart’s unitInterval property in that code. It is very important to set it during the Chart’s initialization, because of the rendering of the X-Axis.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello,
I added a unitInterval based on the number of values …
Same problem.Sylvain
Hi,
first of all, let me wish you a happy new year.
Then, how can we advance on this issue ?
Thanks
SylvainHi Sylvain,
By typing a big value in your input we get the following message: “Error in Json Intensity” generated from your script. Please, check whether the returned JSON on your side is correct.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comYes my json is ok.
You can try it using the following link :
http://noolibee.noolitic.biz/Plugins/plugins/GetIntensityLastValues?id=9daa3a45-b801-4756-b264-704e059f5ef2&last=1000last=1000 is the number of values you want to get.
Thanks
Hi SylvainD,
By setting the “id: ‘Date'” in the source object you define that the Date should be unique id. However, in the JSON you repeating unique ids and that raises the issue. If you don’t need the “Date” field to be unique, do not set the source object’s id field.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi,
it seems to work without the ‘id’ value set to ‘date’.
Thanks
Sylvain -
AuthorPosts
You must be logged in to reply to this topic.