Skip to content

Commit

Permalink
add labels to axis. #224
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcncgr committed Apr 16, 2024
1 parent af4908b commit bdc66aa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/core/lis-histogram-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,22 @@ export class LisHistogramElement extends LitElement {

// Add the y-axis
svgContainer.append('g').call(d3.axisLeft(y));

// Add the x-axis label
svgContainer
.append('text')
.attr('transform', 'translate(' + 500 / 2 + ' ,' + (500 + 40) + ')')
.style('text-anchor', 'middle')
.text('Name');

// Add the y-axis label
svgContainer
.append('text')
.attr('transform', 'rotate(-90)')
.attr('y', 0 - 50)
.attr('x', 0 - 500 / 2)
.attr('dy', '1em')
.style('text-anchor', 'middle')
.text('Count');
}
}

0 comments on commit bdc66aa

Please sign in to comment.