2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 23:46:35 +00:00
fhem-mirror/fhem/www/frontend/app/view/LineChartView.js
johannnes e9ec74a1f1 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://svn.fhem.de/fhem/trunk@2767 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2013-02-19 18:54:42 +00:00

65 lines
1.7 KiB
JavaScript

/**
* 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);
}
});