Open hishoss opened 6 years ago
xFormat and yFormat seem to have no effect on a graph widget.
in my widgets.py I have: class MyGraph(GraphWidget): title = 'My Graph' def get_data(self): return [{'x': x, 'y': x} for x in range(5)]
then in dashing-config.js:
employers.addWidget('MyGraph', 'Graph', { color: 'black', scope: { xFormat(n) { return '(' + n + ')'; }, yFormat(n) { return '(' + n + ')'; }, }, getData: function () { var self = this; Dashing.utils.get('myGraph', function(data) { $.extend(self.scope, data, { title: 'Test Graph!', properties: { renderer: 'bar', padding: { top: 0.1, right: 0.1 } }, }); }); }, interval: 2000 });
xFormat and yFormat seem to have no effect on a graph widget.
in my widgets.py I have: class MyGraph(GraphWidget): title = 'My Graph' def get_data(self): return [{'x': x, 'y': x} for x in range(5)]
then in dashing-config.js:
employers.addWidget('MyGraph', 'Graph', { color: 'black', scope: { xFormat(n) { return '(' + n + ')'; }, yFormat(n) { return '(' + n + ')'; },
}, getData: function () { var self = this; Dashing.utils.get('myGraph', function(data) { $.extend(self.scope, data, { title: 'Test Graph!', properties: { renderer: 'bar', padding: { top: 0.1, right: 0.1 } }, }); }); }, interval: 2000 });