SergSt
7 Dec 2011, 11:40 PM
Below is a simple example, what i'd like to have is a way to control step size between ticks.
Say, define an arbitrary value for a step(1 or 5 or whatever user feels more suitable in his particular case).
Looks that such calculations now sort of "predefined" in Ext.Draw.draw.snapEnds,
but may be anyone found a suitable and not too much 'hackish'(i mean, some other then overriding private methods) way to let user decide step-related stuff..
var store_example1 = Ext.create('Ext.data.JsonStore', {
fields: ['x_data', 'y_data1'],
data: [
{'x_data':0, 'y_data1':3},
{'x_data':1, 'y_data1':7},
{'x_data':2, 'y_data1':37},
{'x_data':3, 'y_data1':17},
{'x_data':4, 'y_data1':24}
]
});
var example1_linechart_cf = {
xtype : 'chart',
store : store_example1,
axes : [
{
type: 'Numeric',
position : 'left',
fields : ['y_data1'],
grid : true,
title : 'Y-measure',
minimum : 0,
adjustMinimumByMajorUnit: 0,
label : {
renderer : Ext.util.Format.numberRenderer('0.0'),
}
},
{
type : 'Numeric',
position : 'bottom',
fields : ['x_data'],
title : 'X-measure',
label : {
renderer : Ext.util.Format.numberRenderer('0.0'),
rotate : {
degrees : -15
}
}
}],
series : [{
type : 'line',
xField : 'x_data',
yField : ['y_data1'],
smooth : true,
fill : true,
showMarkers : true
}],
listeners : {
beforerefresh : function(chart, options) {
}
}
}, example1_linechart = new Ext.chart.Chart(example1_linechart_cf);
var my_win = new Ext.window.Window({
width : '70%',
height : '80%',
minWidth : 550,
minHeight : 300,
layout : 'fit',
collapsible : true,
title : 'Example 1',
items : example1_linechart,
renderTo : Ext.getBody()
});
my_win.show();
Say, define an arbitrary value for a step(1 or 5 or whatever user feels more suitable in his particular case).
Looks that such calculations now sort of "predefined" in Ext.Draw.draw.snapEnds,
but may be anyone found a suitable and not too much 'hackish'(i mean, some other then overriding private methods) way to let user decide step-related stuff..
var store_example1 = Ext.create('Ext.data.JsonStore', {
fields: ['x_data', 'y_data1'],
data: [
{'x_data':0, 'y_data1':3},
{'x_data':1, 'y_data1':7},
{'x_data':2, 'y_data1':37},
{'x_data':3, 'y_data1':17},
{'x_data':4, 'y_data1':24}
]
});
var example1_linechart_cf = {
xtype : 'chart',
store : store_example1,
axes : [
{
type: 'Numeric',
position : 'left',
fields : ['y_data1'],
grid : true,
title : 'Y-measure',
minimum : 0,
adjustMinimumByMajorUnit: 0,
label : {
renderer : Ext.util.Format.numberRenderer('0.0'),
}
},
{
type : 'Numeric',
position : 'bottom',
fields : ['x_data'],
title : 'X-measure',
label : {
renderer : Ext.util.Format.numberRenderer('0.0'),
rotate : {
degrees : -15
}
}
}],
series : [{
type : 'line',
xField : 'x_data',
yField : ['y_data1'],
smooth : true,
fill : true,
showMarkers : true
}],
listeners : {
beforerefresh : function(chart, options) {
}
}
}, example1_linechart = new Ext.chart.Chart(example1_linechart_cf);
var my_win = new Ext.window.Window({
width : '70%',
height : '80%',
minWidth : 550,
minHeight : 300,
layout : 'fit',
collapsible : true,
title : 'Example 1',
items : example1_linechart,
renderTo : Ext.getBody()
});
my_win.show();