Skip to content

Commit ae72963

Browse files
authored
Merge pull request #15 from topcoder-platform/fix/missing-tooltip
fix: show tooltip on distribution graph
2 parents 8518714 + 14e6fbb commit ae72963

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/components/ProfileStatsPage/ChartTooltip/index.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ const ChartTooltip = ({
1818
ratingColor,
1919
link,
2020
}) => {
21-
if (link == null) {
22-
return null;
23-
}
24-
2521
const popup = (
2622
<>
2723
<div styleName="tooltip-rating" style={{ backgroundColor: ratingColor }}>

src/components/ProfileStatsPage/DistributionGraph/index.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,19 @@ export default class DistributionGraph extends React.Component {
203203
.attr("y", (d) => yScale(d.number))
204204
.attr("width", xScale.rangeBand())
205205
.attr("height", (d) => totalH - padding.bottom - yScale(d.number))
206-
.on("mouseover", (d) => {
207-
const e = d3.event;
208-
$scope.setState({
209-
show: true,
210-
left: e.pageX,
211-
top: e.pageY,
212-
challengeName: `${d.number} Coders`,
213-
challengeData: `Rating Range: ${d.start} - ${d.start + 99}`,
214-
rating: d.number,
215-
ratingColor: getRatingColor(d.start),
216-
});
206+
.on({
207+
mouseover: (d) => {
208+
const e = d3.event;
209+
$scope.setState({
210+
show: true,
211+
left: e.pageX,
212+
top: e.pageY,
213+
challengeName: `${d.number} Coders`,
214+
challengeData: `Rating Range: ${d.start} - ${d.start + 99}`,
215+
rating: d.number,
216+
ratingColor: getRatingColor(d.start),
217+
});
218+
},
217219
})
218220
.on("mousemove", () => {
219221
const e = d3.event;

0 commit comments

Comments
 (0)