PDA

View Full Version : [FIXED] Safari bug in column chart



bobkersten
4 Mar 2011, 6:42 AM
Hello,

I think I've found a bug in the column (and area) chars in Ext4 pr3. It seems to "hang" in Safari while working perfectly on other browsers (confirmed with Firefox and Chrome).

The following code seems to reproduce this bug:


<html>
<body>

<div id="ext_bar_graph" class="box"></div>

<style type="text/css" media="screen">
@import url(admin/lib/ext-4.0-pr3/resources/css/ext-standard.css);
</style>
<script type="text/javascript" src="admin/lib/ext-4.0-pr3/bootstrap.js" charset="utf-8"></script>
<script type="text/javascript">
// <![CDATA[
Ext.onReady(function(){

var dxs_data = new Array();
var dxs_data_total = new Array();
var dxs_fields = new Array();
dxs_fields.push( 'Pay Per Minute' );
dxs_fields.push( 'Pay Per Call' );
dxs_fields.push( 'iDeal Pro' );
dxs_data.push( { name:'6' , 'Pay Per Minute':2015, 'Pay Per Call':1080, 'iDeal Pro':1585 } );
dxs_data_total.push( { name:'Pay Per Minute', total:2015 } );
dxs_data_total.push( { name:'Pay Per Call', total:1080 } );
dxs_data_total.push( { name:'iDeal Pro', total:1585 } );

var store = new Ext.data.JsonStore( { fields: dxs_fields, data: dxs_data } );
var store_total = new Ext.data.JsonStore( { fields: dxs_fields, data: dxs_data_total } );

var dxs_type = 'area';
var dxs_stacked = true;
if ( dxs_type == 'area' && dxs_data.length == 1 ) {
dxs_type = 'column';
}
if ( dxs_data.length == 1 ) {
dxs_stacked = false;
}

new Ext.chart.Chart( {
renderTo: Ext.get( 'ext_bar_graph' ),
animate: true,
width: 600,
height: 400,
insetPadding: 20,
store: store,
legend: {
position: 'bottom'
},
axes: [ {
type: 'Numeric',
position: 'left',
fields: dxs_fields,
title: false,
grid: true
}, {
type: 'Category',
position: 'bottom',
fields: ['name'],
title: false
} ],
series: [ {
type: dxs_type,
axis: 'left',
xField: 'name',
yField: dxs_fields,
stacked: dxs_stacked
} ]
} );

} );
// ]]>
</script>

</body>
</html>

Cheers,
Bob.

bobkersten
4 Mar 2011, 7:14 AM
It appears that other browsers choke on this one too... chrome and IE7 in particular.

Jamie Avins
4 Mar 2011, 8:10 AM
Thank you for the test case, we'll check it out.

Jamie Avins
4 Mar 2011, 9:10 AM
Found the issue, was specific to having a single point on an axis with a gutter. We'll have a specific check for that for the next release.