Code:
Application.views.ProgressViewGraph = Ext.extend(Ext.chart.Chart,{
id : 'ProgressViewGraphID',
animate: true,
store: 'ProgrssCharts',
legend: {
position: 'top'
},
axes: [
{
type: 'Numeric',
position: 'left',
title: 'Weight',
fields: ['measure_value'],
minorTickSteps: 1,
minimum: 0,
grid: {
odd: {
opacity: 1,
fill: '#ddd',
stroke: '#bbb',
'stroke-width': 1
}
},
adjustMinimumByMajorUnit: 0
},
{
type: 'Category',
position: 'bottom',
fields: ['measure_date']
}
],
series: [{
type: 'line',
highlight: {
size: 7,
radius: 7
},
fill: true,
smooth: true,
axis: 'left',
xField: 'measure_date',
yField: 'measure_value'
},
{
type: 'line',
highlight: {
size: 7,
radius: 7
},
fill: true,
smooth: true,
axis: 'left',
xField: 'measure_date',
yField: 'goal'
}]
});
Application.views.ProgressViewChartPanel = Ext.extend(Ext.Panel,{
id : 'ProgressViewChartID',
scroll : 'vertical',
layout: 'fit',
initComponent : function(){
Ext.apply(Application.views,{
progressViewGraph : new Application.views.ProgressViewGraph()
});
Ext.apply(this,{
items: [Application.views.progressViewGraph]
});
Application.views.ProgressViewChartPanel.superclass.initComponent.apply(this,arguments);
},
listeners : {
afterrender :function(p){
this.addDocked([
{
xtype : 'toolbar',
ui : 'toolbarCls',
dock : 'top',
title : 'Progress',
items :[
{
xtype : 'button',
ui : 'btnlight',
text : 'back',
cls : 'back',
handler : function(){
var hash = window.location.hash.split('/');
var measure_id = hash[2];
var url = 'progress/progress_tracker/'+measure_id;
Ext.redirect(url);
}
}
]
},
]);
}
}
});
Ext.reg('ProgressViewCharts', Application.views.ProgressViewChartPanel);
I get this