PDA

View Full Version : Axis labels are not visible of an chart in ExtJS 4



shekhar.kotekar
20 Apr 2012, 4:09 AM
Hi,

I am trying to draw an chart inside panel. Chart bars are getting drawn correctly but x and y axis labels are not shown when chart is drawn. Code to draw chart is as follows :



Ext.require([ 'Ext.form.*', 'Ext.chart.*', 'Ext.layout.container.*' ]); Ext.define('ilp.view.EmployeeCountControl', { extend : 'Ext.panel.Panel', alias : 'widget.employeeCountControl', require : [ 'ilp.store.Employees', 'ilp.store.Dimensions' ], layout : { type : 'vbox', align : 'stretch', pack : 'start' }, title : 'Select dimension to view chart', initComponent : function() { this.items = [ { xtype : 'combobox', fieldLabel : 'Select Dimension', store : 'Dimensions', queryMode : 'local', displayField : 'name', valueField : 'dimension', flex : 1 }, { xtype : 'chart', title : 'selected dimension', store : 'Employees', flex : 2, width: 150, height: 200, legend : { position : 'right' }, axes : [ { title : 'Emp Count', type : 'Numeric', position : 'left', fields : ['hpCount', 'nonhpCount'], minimum : 0, grid : true }, { title : 'selected dimension', type : 'Category', position : 'bottom', fields : ['dimension'] } ], series : [ { type : 'bar', column :true, stacked : true, highlight: true, axis : 'left', xField : ['dimension'], yField : ['hpCount', 'nonhpCount'], yPadding : 10 } ] } ]; this.callParent(arguments); } });

and what gets drawn is as follows :

34301

As you can see, title and axis values are not being displayed on chart.
Can anyone please tell me why this is happening??

After moving legend to bottom, I got x axis values but now those values are getting hidden behind legend and also those values are going out of panel.

Does anyone knows how to decrease the size of actual chart and bars to fit axis values properly?

My chart now looks as follows :

34302

Thanks in advance !!

scottmartin
21 Apr 2012, 6:39 AM
Please try using 4.1RC3 and see if this problem still exists:
http://www.sencha.com/forum/showthread.php?194793

If so, please report back with a working example:
http://www.sencha.com/forum/showthread.php?138165-How-to-report-a-bug

Regards,
Scott.

shekhar.kotekar
22 Apr 2012, 9:48 PM
Hi Scott,

Thanks for your reply. I have downloaded and installed 4.1RC3. My problem is partially solved. Now EXTJSIV-5852 - Stacked Bar Chart shadow/border ghosts on redraw error is gone but still labels under each bar are not visible.

Is it another one bug in ExtJS?

scottmartin
23 Apr 2012, 4:21 AM
This has corrected in the next release. If you have access to the nightly builds, you can get it from there.

Regards,
Scott.