diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-03-07 17:37:41 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-03-07 17:37:41 +0100 |
commit | b01cbc17e83ec2354556e3ee9805e12b8a823f21 (patch) | |
tree | 7ba39485dc5b4a4d2e28cea4fca2ebb02b9881d2 /server/sonar-web/src | |
parent | 94d4858fcc910344715a47cda6fe0fe402d65491 (diff) | |
download | sonarqube-b01cbc17e83ec2354556e3ee9805e12b8a823f21.tar.gz sonarqube-b01cbc17e83ec2354556e3ee9805e12b8a823f21.zip |
SONAR-7405 display treemap legend
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js | 11 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/styles.css | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js index f9db563b419..c4a0ecc2e55 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureTreemap.js @@ -23,7 +23,7 @@ import Spinner from './Spinner'; import { Treemap } from '../../../components/charts/treemap'; import { getChildren } from '../../../api/components'; import { formatMeasure } from '../../../helpers/measures'; -import { translate } from '../../../helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getComponentUrl } from '../../../helpers/urls'; import Workspace from '../../../components/workspace/main'; @@ -197,6 +197,7 @@ export default class MeasureTreemap extends React.Component { } render () { + const { metric } = this.props; const { fetching } = this.state; if (fetching) { @@ -211,6 +212,14 @@ export default class MeasureTreemap extends React.Component { return ( <div className="measure-details-treemap"> + <ul className="list-inline note measure-details-treemap-legend"> + <li> + {translateWithParameters('component_measures.legend.color_x', metric.name)} + </li> + <li> + {translateWithParameters('component_measures.legend.size_x', translate('metric.ncloc.name'))} + </li> + </ul> {this.renderTreemap()} </div> ); diff --git a/server/sonar-web/src/main/js/apps/component-measures/styles.css b/server/sonar-web/src/main/js/apps/component-measures/styles.css index b9cbca5ccec..4bf606fac58 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/styles.css +++ b/server/sonar-web/src/main/js/apps/component-measures/styles.css @@ -246,5 +246,9 @@ .measure-details-treemap { max-width: 960px; - margin: 10px auto; + margin: 20px auto; +} + +.measure-details-treemap-legend { + margin-bottom: 10px; } |