PDA

View Full Version : MajorUnit Problèm



aymanadou
18 Mar 2011, 5:11 AM
Hi every body ,
in fact "majorUnit" attribute in Numeric axis doesn't any effect on my chart .
Any solution plz

var win = {
width: 500,
height: 800,
title: 'Open Projects ',
collapsible :false,
items: {
xtype: 'chart',
id :'charttask',
width: 500,
height: 800,
animate: true,
theme : 'Category1',
legend: {
position: 'bottom'
},
store: Taskstore,
axes: [ {
type :'Numeric',
majorUnit: 30,
position: 'left',
fields: ['Workload', 'Realized', 'Estimation']

},
{
type: 'Category',
position: 'bottom',
fields: ['Task'],
label: {
renderer :function (val){
var part1 = val.substr(0,25);
var s = Ext.String.format('{0}...', part1);
return s;
},
rotate: {
degrees: -90
}
},
grid: true
}],
series: [{
type: 'column',
axis: 'left',
smooth: true,
fill: true,
xField: 'Task',
yField: 'Workload',
tips: {
trackMouse: true,
width: 150,
height: 100,
renderer: function(storeItem, item) {
this.setTitle(' '+storeItem.get('Task')+' Workload:'+' '+storeItem.get('Workload')+'days' );
}},
style: {
fill: '#194885'
}

}, {
type: 'line',
axis: 'left',
xField: 'Task',
yField: 'Estimation',
smooth: true,
fill: true,
fillOpacity: 0.9,
style: {
fill: '#E38D1E'
},
tips: {
trackMouse: true,
width: 150,
height: 100,
renderer: function(storeItem, item) {
this.setTitle('Estimation: '+storeItem.get('Estimation')+'days' );
}},
markerCfg: {
type: 'circle',
size: 5
}
}, {
type: 'line',
axis: 'left',
smooth: true,
fill: true,
fillOpacity: 0.4,
xField: 'Task',
yField: 'Realized',
tips: {
trackMouse: true,
width: 150,
height: 100,
renderer: function(storeItem, item) {
this.setTitle('Realized: '+storeItem.get('Realized')+'days' );
}},
markerCfg: {
type: 'cross',
size: 3
}
}]
}}

philogb
22 Mar 2011, 9:16 AM
Hi,

Thanks for you message. The majorUnit param was there to keep with the legacy API but now has no effect to the chart. We pushed a small API change that should solve your problem. By using "maximum", "minimum" and "majorTickSteps" you can customize the grid and lines exactly as you want.

All values between maximum and minimum will be displayed and the number of lines/ticks in the axis will correspond to majorTickSteps.

I hope this helps,