Skip to content

Commit

Permalink
Merge pull request #15 from topcoder-platform/fix/missing-tooltip
Browse files Browse the repository at this point in the history
fix: show tooltip on distribution graph
  • Loading branch information
rakibansary authored Oct 14, 2021
2 parents 8518714 + 14e6fbb commit ae72963
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/components/ProfileStatsPage/ChartTooltip/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const ChartTooltip = ({
ratingColor,
link,
}) => {
if (link == null) {
return null;
}

const popup = (
<>
<div styleName="tooltip-rating" style={{ backgroundColor: ratingColor }}>
Expand Down
24 changes: 13 additions & 11 deletions src/components/ProfileStatsPage/DistributionGraph/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,19 @@ export default class DistributionGraph extends React.Component {
.attr("y", (d) => yScale(d.number))
.attr("width", xScale.rangeBand())
.attr("height", (d) => totalH - padding.bottom - yScale(d.number))
.on("mouseover", (d) => {
const e = d3.event;
$scope.setState({
show: true,
left: e.pageX,
top: e.pageY,
challengeName: `${d.number} Coders`,
challengeData: `Rating Range: ${d.start} - ${d.start + 99}`,
rating: d.number,
ratingColor: getRatingColor(d.start),
});
.on({
mouseover: (d) => {
const e = d3.event;
$scope.setState({
show: true,
left: e.pageX,
top: e.pageY,
challengeName: `${d.number} Coders`,
challengeData: `Rating Range: ${d.start} - ${d.start + 99}`,
rating: d.number,
ratingColor: getRatingColor(d.start),
});
},
})
.on("mousemove", () => {
const e = d3.event;
Expand Down

0 comments on commit ae72963

Please sign in to comment.