Skip to content

Commit

Permalink
two visualisations done
Browse files Browse the repository at this point in the history
  • Loading branch information
charfimohamed committed May 25, 2024
1 parent f301cba commit 953cf36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/playerBarChart.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
.attr("height", height + margin.top + margin.bottom);

// Group used to enforce margin
const g = svg.append("g").attr("transform", `translate(${margin.left+60},${margin.top})`);
const g = svg.append("g").attr("transform", `translate(${margin.left+40},${margin.top})`);

// Global variable for all data
let data;
Expand Down Expand Up @@ -102,13 +102,13 @@
// Append legend to the SVG container
const legend = svg.append("g")
.attr("class", "legend")
.attr("transform", `translate(${width - margin.right + 80}, ${margin.top + 250})`);
.attr("transform", `translate(${width - margin.right + 100}, ${margin.top + 250})`);

// Add background contour
legend.append("rect")
.attr("x", -5)
.attr("y", -5)
.attr("width", 80)
.attr("width", 60)
.attr("height", Object.keys(positionColors).length * 20 + 10)
.attr("fill", "rgba(255, 255, 255, 0.8)")
.attr("stroke", "black")
Expand Down Expand Up @@ -171,7 +171,7 @@
const top_20_data = new_data.slice(0, 20);

// Update the scales
xscale.domain([80, 100]);
xscale.domain([70, 100]);
yscale.domain(top_20_data.map((d) => d['Player']));

// Render the axis
Expand Down

0 comments on commit 953cf36

Please sign in to comment.