-
23 Nov 2011 5:57 AM #1
Unanswered: Issue with piechart
Unanswered: Issue with piechart
Hello,
I'm having an Error on chrome (IE doesnt mind it though) while opening a panel with a pie chart in it. The error comes from the legend: section.
Error: Invalid value for <rect> attribute height="NaN"
Error: Invalid value for <rect> attribute y="NaN"
Error: Invalid value for <rect> attribute height="NaN"
I've searched over the net and modified the code dozens of times and nothing works...
Even after I get this error messages, the pie works fine...
Can anyone help me? Thank you!
Code:var pieChart = new Ext.chart.Chart({ animate: true, store: pieStore, shadow: true, legend: { position: 'right' }, insetPadding: 50, theme: 'Base:gradients', series: [{ type: 'pie', field: 'num_repetition', showInLegend: true, tips: { trackMouse: true, width: 170, height: 40, renderer: function(storeItem) { //calculate percentage. this.setTitle(storeItem.get('log_type_name') + ': ' + Math.round(storeItem.get('num_repetition') / total * 100) + '%' +'<br>occurrences: '+ storeItem.get('num_repetition')); } }, highlight: { segment: { margin: 20 } }, label: { field: 'log_type_name', contrast: true, font: '12px Arial' } }] });threethazzCode:var panel1 = Ext.create('widget.panel', { width: 800, height: 800, title: 'Requests', layout: 'fit', items: [pieChart] }); panel1.render('render');Last edited by threethazz; 23 Nov 2011 at 5:58 AM. Reason: color
-
23 Nov 2011 7:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
What does your response look like?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Nov 2011 7:27 AM #3
I'm sorry, I forgot that part.
The data is loaded correctly, and it is also correctly displayed. It's only those 3 errors showing up in the Chrome console.
Code:if (!Ext.ClassManager.isCreated('AdminStatistics')){ Ext.define('AdminStatistics',{ extend: 'Ext.data.Model', fields: [ 'log_type_id', 'log_type_name', 'company_id', 'num_repetition' ] }); } var pieStore = Ext.create('Ext.data.Store', { model: 'AdminStatistics', autoLoad: false, proxy: { // load using HTTP type: 'ajax', url: '/AdminStatistics/Statistics', // the return will be XML, so lets set up a reader reader: { type: 'json', root: 'list' }, extraParams:{ company_id: '' } } });
-
25 Nov 2011 2:28 AM #4


Reply With Quote