PDA

View Full Version : Chart inside a tab not working in firefox ?



debabrata
10 Nov 2011, 1:32 AM
Piechart inside a tab working in google chrome but not working in firefox.My code is

Ext.onReady(function(){
var store = new Ext.data.JsonStore({
fields:['name', 'visits', 'views'],
data: [
{name:'Jul 07', visits: 245000, views: 3000000},
{name:'Aug 07', visits: 240000, views: 3500000},
{name:'Sep 07', visits: 355000, views: 4000000}
]
});
var store1 = new Ext.data.JsonStore({
fields: ['season', 'total'],
data: [{
season: 'Summer',
total: 150
},{
season: 'Fall',
total: 245
},{
season: 'Winter',
total: 117
},{
season: 'Spring',
total: 184
}]
});
var pchart = new Ext.chart.PieChart({
title: 'Long Text',
xtype: 'piechart',
url: '../../resources/charts.swf',
store: store1,
dataField: 'total',
categoryField: 'season',
//extra styles get applied to the chart defaults
extraStyle:
{
legend:
{
display: 'bottom',
padding: 5,
font:
{
family: 'Tahoma',
size: 13
}
}
}
});
var tabs = new Ext.TabPanel({
renderTo: 'tabs',
width:450,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
items:[
{
title: 'Linechart',
html: 'hiiiiiiiiiiiiiiiiiiiiiiiiiiiiii'
}, pchart

]
});
});
thanx in advance.....

mitchellsimoens
18 Nov 2011, 12:23 PM
Take away the defaults config on the TabPanel that is setting the autoHeight and it will work for you.

Also, always post your code within code tags, helps us read it.


var store1 = new Ext.data.JsonStore({
fields: ['season', 'total'],
data: [{
season: 'Summer',
total: 150
},{
season: 'Fall',
total: 245
},{
season: 'Winter',
total: 117
},{
season: 'Spring',
total: 184
}]
});

var pchart = new Ext.chart.PieChart({
title: 'Long Text',
store: store1,
dataField: 'total',
categoryField: 'season',
extraStyle: {
legend: {
display: 'bottom',
padding: 5,
font: {
family: 'Tahoma',
size: 13
}
}
}
});

var tabs = new Ext.TabPanel({
renderTo: Ext.getBody(),
width:450,
activeTab: 0,
frame:true,
items:[
{
title: 'Linechart',
html: 'hiiiiiiiiiiiiiiiiiiiiiiiiiiiiii'
},
pchart
]
});

debabrata
20 Nov 2011, 9:39 AM
thanks
mitchellsimoens (http://www.sencha.com/forum/member.php?22216-mitchellsimoens)it really worked for me.thanks very much.