Browse Source

graph legend: fix table alignment

Alexander Zobnin 7 years ago
parent
commit
e4b3f31f82

+ 6 - 1
public/app/plugins/panel/graph/Legend/Legend.tsx

@@ -250,7 +250,10 @@ class LegendTable extends PureComponent<Partial<LegendComponentProps>> {
     const seriesValuesProps = { values, min, max, avg, current, total };
     return (
       <table>
-        <tbody>
+        <colgroup>
+          <col style={{ width: '100%' }} />
+        </colgroup>
+        <thead>
           <tr>
             <th style={{ textAlign: 'left' }} />
             {LEGEND_STATS.map(
@@ -266,6 +269,8 @@ class LegendTable extends PureComponent<Partial<LegendComponentProps>> {
                 )
             )}
           </tr>
+        </thead>
+        <tbody>
           {seriesList.map((series, i) => (
             <LegendItem
               key={`${series.id}-${i}`}

+ 3 - 4
public/sass/components/_panel_graph.scss

@@ -136,11 +136,10 @@
 }
 
 .graph-legend-table {
+  table {
+    width: 100%;
+  }
   tbody {
-    display: block;
-    position: relative;
-    overflow-y: auto;
-    overflow-x: hidden;
     padding-bottom: 1px;
     padding-right: 5px;
     padding-left: 5px;