From dd4eab17222dcc8e3efc74d66a71e3845ad1e658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 5 Nov 2018 13:44:09 +0100 Subject: [PATCH] panel options wip --- public/app/plugins/panel/graph2/module.tsx | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/public/app/plugins/panel/graph2/module.tsx b/public/app/plugins/panel/graph2/module.tsx index 4011458bea9..7bb2ab48e40 100644 --- a/public/app/plugins/panel/graph2/module.tsx +++ b/public/app/plugins/panel/graph2/module.tsx @@ -12,6 +12,10 @@ import { PanelProps, NullValueMode } from 'app/types'; interface Options { showBars: boolean; + showLines: boolean; + showPoints: boolean; + + onChange: (options: Options) => void; } interface Props extends PanelProps { @@ -35,14 +39,27 @@ export class Graph2 extends PureComponent { } } -export class TextOptions extends PureComponent { - onChange = () => {}; +export class TextOptions extends PureComponent { + onToggleLines = () => { + const options = this.props as Options; + + this.props.onChange({ + ...options, + showLines: !this.props.showLines, + }); + }; render() { + const { showBars, showPoints, showLines } = this.props; + return ( -
-
Draw Modes
- +
+
+
Draw Modes
+ + + +
); }