Commit ef3c9139 by Peter Holmberg

min and max value

parent 60ec00ae
...@@ -15,8 +15,6 @@ export interface OptionsProps { ...@@ -15,8 +15,6 @@ export interface OptionsProps {
suffix: string; suffix: string;
unit: string; unit: string;
thresholds: Threshold[]; thresholds: Threshold[];
minValue: number;
maxValue: number;
} }
export const defaultProps = { export const defaultProps = {
......
...@@ -7,8 +7,6 @@ import kbn from '../core/utils/kbn'; ...@@ -7,8 +7,6 @@ import kbn from '../core/utils/kbn';
interface Props { interface Props {
decimals: number; decimals: number;
timeSeries: TimeSeriesVMs; timeSeries: TimeSeriesVMs;
minValue: number;
maxValue: number;
showThresholdMarkers: boolean; showThresholdMarkers: boolean;
thresholds: Threshold[]; thresholds: Threshold[];
showThresholdLabels: boolean; showThresholdLabels: boolean;
...@@ -40,7 +38,7 @@ export class Gauge extends PureComponent<Props> { ...@@ -40,7 +38,7 @@ export class Gauge extends PureComponent<Props> {
this.draw(); this.draw();
} }
componentDidUpdate(prevProps: Props) { componentDidUpdate() {
this.draw(); this.draw();
} }
...@@ -52,17 +50,9 @@ export class Gauge extends PureComponent<Props> { ...@@ -52,17 +50,9 @@ export class Gauge extends PureComponent<Props> {
} }
draw() { draw() {
const { const { timeSeries, showThresholdLabels, showThresholdMarkers, thresholds, width, height, stat } = this.props;
timeSeries,
maxValue, console.log(thresholds);
minValue,
showThresholdLabels,
showThresholdMarkers,
thresholds,
width,
height,
stat,
} = this.props;
const dimension = Math.min(width, height * 1.3); const dimension = Math.min(width, height * 1.3);
const backgroundColor = config.bootData.user.lightTheme ? 'rgb(230,230,230)' : 'rgb(38,38,38)'; const backgroundColor = config.bootData.user.lightTheme ? 'rgb(230,230,230)' : 'rgb(38,38,38)';
...@@ -85,8 +75,8 @@ export class Gauge extends PureComponent<Props> { ...@@ -85,8 +75,8 @@ export class Gauge extends PureComponent<Props> {
series: { series: {
gauges: { gauges: {
gauge: { gauge: {
min: minValue, min: thresholds[0].value,
max: maxValue, max: thresholds[thresholds.length - 1].value,
background: { color: backgroundColor }, background: { color: backgroundColor },
border: { color: null }, border: { color: null },
shadow: { show: false }, shadow: { show: false },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment