Skip to content

Commit

Permalink
Fixing scaling on graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmoruwaTolu committed Apr 24, 2024
1 parent 4a65614 commit c149eab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions prem-data/src/components/scatter-chart/scatter-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ function ScatterGraph({data}){
const svgRef = useRef();

useEffect(() => {
const w = 400
const w = 250
const h = 300
const svg = d3.select(svgRef.current)
.attr('width', w)
.attr('height', h)
.style('overflow', 'visible')
.style('margin-top', '100px')

const xScale = d3.scaleLinear()
.domain([0, 50])
Expand Down Expand Up @@ -49,12 +48,12 @@ function ScatterGraph({data}){
.text('y')

svg.selectAll()
.data(plotData)
.data(data)
.enter()
.append('circle')
.attr('cx', d => xScale(d.totalXGD))
.attr('cy', d => yScale(d.points))
.attr('r', 7)
.attr('r', 4)
.style("fill", d => `${teamColours[d.clubname]}`)


Expand Down

0 comments on commit c149eab

Please sign in to comment.