ryan 6 лет назад
Родитель
Сommit
8be56f8a0e
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      public/app/plugins/panel/singlestat2/SingleStatPanel.tsx

+ 10 - 2
public/app/plugins/panel/singlestat2/SingleStatPanel.tsx

@@ -1,5 +1,5 @@
 // Libraries
 // Libraries
-import React from 'react';
+import React, { CSSProperties } from 'react';
 
 
 // Types
 // Types
 import { SingleStatOptions } from './types';
 import { SingleStatOptions } from './types';
@@ -8,9 +8,17 @@ import { SingleStatBase } from './SingleStatBase';
 
 
 export class SingleStatPanel extends SingleStatBase<SingleStatOptions> {
 export class SingleStatPanel extends SingleStatBase<SingleStatOptions> {
   renderStat(value: DisplayValue, width: number, height: number) {
   renderStat(value: DisplayValue, width: number, height: number) {
+    const style: CSSProperties = {};
+    style.margin = '0 auto';
+    style.fontSize = '250%';
+    style.textAlign = 'center';
+    if (value.color) {
+      style.color = value.color;
+    }
+
     return (
     return (
       <div style={{ width, height }}>
       <div style={{ width, height }}>
-        <b>{value.text}</b>
+        <div style={style}>{value.text}</div>
       </div>
       </div>
     );
     );
   }
   }