initial upload of new Javascript Frontend based on ExtJS (by Johannes)
- contains ExtJS Library 4.1.1a, together with css and images - is related to the module 93_DbLog.pm, which holds some functions used by the frontend git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2767 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
65
www/frontend/app/view/LineChartView.js
Normal file
65
www/frontend/app/view/LineChartView.js
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* The View for the Line Charts
|
||||
*/
|
||||
Ext.define('FHEM.view.LineChartView', {
|
||||
extend : 'Ext.chart.Chart',
|
||||
alias : 'widget.linechartview',
|
||||
xtype : 'chart',
|
||||
requires : [ 'FHEM.store.ChartStore' ],
|
||||
style : 'background:#fff',
|
||||
animate : true,
|
||||
shadow : true,
|
||||
theme : 'Category1',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
me.store = Ext.create('FHEM.store.ChartStore');
|
||||
|
||||
me.axes = [ {
|
||||
type : 'Numeric',
|
||||
name : 'yaxe',
|
||||
position : 'left',
|
||||
fields : [ 'VALUE' ],
|
||||
title : 'kW / h',
|
||||
grid : {
|
||||
odd : {
|
||||
opacity : 1,
|
||||
fill : '#ddd',
|
||||
stroke : '#bbb',
|
||||
'stroke-width' : 0.5
|
||||
}
|
||||
}
|
||||
}, {
|
||||
type : 'Time',
|
||||
name : 'xaxe',
|
||||
position : 'bottom',
|
||||
fields : [ 'TIMESTAMP' ],
|
||||
dateFormat : "Y-m-d H:i:s",
|
||||
minorTickSteps : 12,
|
||||
title : 'Time'
|
||||
} ];
|
||||
|
||||
me.series = [ {
|
||||
type : 'line',
|
||||
axis : 'left',
|
||||
xField : 'TIMESTAMP',
|
||||
yField : 'VALUE',
|
||||
smooth: 2,
|
||||
fill: true,
|
||||
highlight: true,
|
||||
tips : {
|
||||
trackMouse : true,
|
||||
width : 140,
|
||||
height : 100,
|
||||
renderer : function(storeItem, item) {
|
||||
this.setTitle(' Value: : ' + storeItem.get('VALUE') +
|
||||
'<br> Time: ' + storeItem.get('TIMESTAMP'));
|
||||
}
|
||||
}
|
||||
} ];
|
||||
|
||||
me.callParent(arguments);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user