PDA

View Full Version : why isn't the xAxis property 'labelSpacing' effective?



carolinfox
21 Jul 2010, 12:09 AM
My code is like below:
======================No.1 js file (add 2 lines in the extjs 3.2.1 example code)================
// extra extra simple
new Ext.Panel({
title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',
renderTo: 'container',
width:1000,
height:300,
layout:'fit',

items: {
xtype: 'linechart',
store: store,
xField: 'name',
yField: 'visits',
xAxis: new Ext.chart.CategoryAxis({
title: 'test XAxis',
labelSpacing: 20 // I add it, and nothing happened.why?
}),
yAxis: new Ext.chart.NumericAxis({
title: 'test YAxis',
labelSpacing: 20 // I add it, and nothing happened.why?
}),
listeners: {
itemclick: function(o){
var rec = store.getAt(o.index);
Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
}
}
}
});
===================No.2 js file=====================================
Another js file:

chartStyle: {
padding: 10,
animationEnabled: true,
font: {
name: 'Tahoma',
color: 0x444444,
size: 11
},
dataTip: {
padding: 5,
border: {
color: 0x99bbe8,
size:1
},
background: {
color: 0xDAE7F6,
alpha: .9
},
font: {
name: 'Tahoma',
color: 0x15428B,
size: 10,
bold: true
}
},
xAxis: {
color: 0x69aBc8,
labelSpacing : 200, // I add it, and nothing happened.why?
majorTicks: {color: 0x69aBc8, length: 4},
minorTicks: {color: 0x69aBc8, length: 2},
majorGridLines: {size: 1, color: 0xeeeeee}

},
yAxis: {
color: 0x69aBc8,
majorTicks: {color: 0x69aBc8, length: 4},
minorTicks: {color: 0x69aBc8, length: 2},
majorGridLines: {size: 1, color: 0xdfe8f6}
}
},
================================================================================
If you can tell me, thank you very much!

Animal
21 Jul 2010, 12:22 AM
Starting the same thread 3 times makes people less likely to answer you.

Condor
21 Jul 2010, 1:32 AM
The first file is obviously incorrect. labelSpacing is a config option of the xAxis and yAxis chartStyle.

Your second file looks ok, but it doesn't contain the entire chart config, so I don't know the rest is ok.

designated
23 Jun 2012, 6:08 AM
I cannot seem to get labelSpacing to do anything either. Has anyone ever had this working?

Thanks