Skip to content

Commit

Permalink
working axis with labels. #224
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcncgr committed Apr 17, 2024
1 parent e13975f commit 5fc55d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/lis-histogram-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ export class LisHistogramElement extends LitElement {
// Add the x-axis label
svgContainer
.append('text')
.attr('transform', 'translate(' + 500 / 2 + ' ,' + (500 + 40) + ')')
.attr(
'transform',
'translate(' + width / 2 + ' ,' + (height + padding) + ')',
)
.style('text-anchor', 'middle')
.style('fill', 'black')
.text('Name');
Expand All @@ -128,8 +131,8 @@ export class LisHistogramElement extends LitElement {
svgContainer
.append('text')
.attr('transform', 'rotate(-90)')
.attr('y', 50)
.attr('x', 500 / 2)
.attr('y', 0 - padding)
.attr('x', 0 - height / 2)
.attr('dy', '1em')
.style('text-anchor', 'middle')
.style('fill', 'black')
Expand Down

0 comments on commit 5fc55d0

Please sign in to comment.