Browse Source

panning

pull/25/head
Alexey Velikiy 3 years ago
parent
commit
a51f2f0df6
  1. 10
      client/src/components/hastic_pod/index.ts

10
client/src/components/hastic_pod/index.ts

@ -12,8 +12,9 @@ export class HasticPod extends LinePod {
super(el, undefined, {
renderLegend: false,
eventsCallbacks: {
zoomIn: range => { this._zoomIn(range) },
zoomOut: ({x, y}) => { this._zoomOut({x, y}) }
zoomIn: range => { this._updateRange(range) },
zoomOut: ({x, y}) => { this._zoomOut({x, y}) },
panningEnd: range => { this._updateRange(range) }
}
});
this._udc = udc;
@ -32,7 +33,10 @@ export class HasticPod extends LinePod {
console.log('render my metrics');
}
private async _zoomIn(range: AxisRange[]) {
private async _updateRange(range: AxisRange[]) {
console.log('update range');
console.log(range);
const ts = await this._udc({ from: range[0][0], to: range[0][1] });
const options = { axis: { x: { range: range[0] } } };
this.updateData(ts, options);

Loading…
Cancel
Save