aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js')
-rw-r--r--server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
index 43dd36a2323..977fd6298fc 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js
@@ -26,8 +26,7 @@ import GraphsTooltipsContentEvents from './GraphsTooltipsContentEvents';
import GraphsTooltipsContentCoverage from './GraphsTooltipsContentCoverage';
import GraphsTooltipsContentDuplication from './GraphsTooltipsContentDuplication';
import GraphsTooltipsContentOverview from './GraphsTooltipsContentOverview';
-import { getLocalizedMetricName } from '../../../helpers/l10n';
-import type { Event, MeasureHistory, Metric } from '../types';
+import type { Event, MeasureHistory } from '../types';
import type { Serie } from '../../../components/charts/AdvancedTimeline';
type Props = {
@@ -36,7 +35,6 @@ type Props = {
graph: string,
graphWidth: number,
measuresHistory: Array<MeasureHistory>,
- metrics: Array<Metric>,
selectedDate: Date,
series: Array<Serie & { translatedName: string }>,
tooltipIdx: number,
@@ -50,7 +48,7 @@ export default class GraphsTooltips extends React.PureComponent {
render() {
const { events, measuresHistory, tooltipIdx } = this.props;
- const top = 50;
+ const top = 30;
let left = this.props.tooltipPos + 60;
let customClass;
if (left > this.props.graphWidth - TOOLTIP_WIDTH - 50) {
@@ -65,7 +63,7 @@ export default class GraphsTooltips extends React.PureComponent {
</div>
<table className="width-100">
<tbody>
- {this.props.series.map(serie => {
+ {this.props.series.map((serie, idx) => {
const point = serie.data[tooltipIdx];
if (!point || (!point.y && point.y !== 0)) {
return null;
@@ -75,20 +73,20 @@ export default class GraphsTooltips extends React.PureComponent {
<GraphsTooltipsContentOverview
key={serie.name}
measuresHistory={measuresHistory}
- serie={serie}
+ name={serie.name}
+ style={idx.toString()}
tooltipIdx={tooltipIdx}
+ translatedName={serie.translatedName}
value={this.props.formatValue(point.y)}
/>
);
} else {
- const metric = this.props.metrics.find(metric => metric.key === serie.name);
return (
<GraphsTooltipsContent
key={serie.name}
- serie={serie}
- translatedName={
- metric ? getLocalizedMetricName(metric) : serie.translatedName
- }
+ name={serie.name}
+ style={idx.toString()}
+ translatedName={serie.translatedName}
value={this.props.formatValue(point.y)}
/>
);