-
7 Feb 2012 5:45 AM #1
Labels on bar chart are incorrectly placed
Labels on bar chart are incorrectly placed
REQUIRED INFORMATION
Ext version tested:- Ext 4.07
- Chrome 16
- IE9
- Firefox 9
- Labels on bar chart are incorrectly placed when display type is 'insideEnd' and all values are 0.
- Create a bar chart
- Assign a store with a number of fields that all have a value of 0
- Place a label on the bar chart that sets the display type to 'insideEnd'
- The label with value should be at the right hand side of the axis bar
- The label with value is placed to the left of the axis bar before the axis category name
Code:Ext.require('Ext.chart.*'); Ext.require(['Ext.Window', 'Ext.fx.target.Sprite','Ext.layout.container.Fit']); Ext.onReady(function () { var store = Ext.create('Ext.data.JsonStore', { fields: ['name', 'data'], data: [ {name : 'Field1', value : 0}, {name : 'Field2', value : 0} ] }); var win = Ext.create('Ext.Window', { width: 200, height: 200, minHeight: 200, minWidth: 200, hidden: false, maximizable: true, title: 'Bar Chart', renderTo: Ext.getBody(), layout: 'fit', items: { id: 'chartCmp', xtype: 'chart', animate: true, shadow: true, store: store, axes: [{ type: 'Category', position: 'left', fields: ['name'], }], series: [{ type: 'bar', axis: 'bottom', highlight: true, label: { display: 'insideEnd', field: 'value', renderer: Ext.util.Format.numberRenderer('0'), orientation: 'horizontal', color: '#333', 'text-anchor': 'middle' }, xField: 'name', yField: ['value'] }] } }); });
HELPFUL INFORMATION
See this URL for live test case: http://jsfiddle.net/cAxCY/1/
Debugging already done:- none
- not provided
- only default ext-all.css
- Windows 7
-
7 Feb 2012 7:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
There is already a bug open for when values are zero.
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.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote