PDA

View Full Version : Beginner needs help getting chart going



jdaum
26 Apr 2012, 1:59 AM
Hi,

I'm working on converting the example Pie chart into a working, database based version. I have setup an Ajax/ JSON store like this:


Ext.define('Chart', {
extend: 'Ext.data.Model',
fields: ['name', 'value']
});

//The Store contains the AjaxProxy as an inline configuration
var store = Ext.create('Ext.data.Store', {
model: 'Chart',
proxy: {
type: 'ajax',
url : '/backend/report/data'
}
});

store.load();

my data comes from here: http://analyser.automatem.co.nz/backend/report/data

One of the confusing items is that the example uses many data series, I can only see that I need one to show a pie chart with 3 pieces.

When I load the whole chart, I get the legend, but the image seems to only have a little bit in the top left corner. I checked if this is an issue with SVG display here: http://www.webpagetest.org/result/120426_NF_43F05/ and while this looks differently, it seems to be wrong as well.

My page is here: http://analyser.automatem.co.nz/backend/report

Can anyone give me tips to get over this hurdle?

Thanks in advance,

Jochen

sskow200
26 Apr 2012, 5:38 AM
http://jsfiddle.net/z6PgK/


My guess would be you're not setting a height/width for your chart. If you wish to have the chart stretch to an unknown width, you need to embed the chart inside a panel with a 'fit' layout.