react-calendar-heatmap icon indicating copy to clipboard operation
react-calendar-heatmap copied to clipboard

Weekday labels style don't take any effect

Open shivamka1 opened this issue 1 year ago • 1 comments

I was trying to add some space between weekday lables and the graph but it doesn't seem to take any effect!

.react-calendar-heatmap-weekday-labels {
  margin-right: 5px !important;
  padding-right: 5px !important;
}

The only thing that seems to work is:

const weekdayLabels = document.getElementsByClassName('react-calendar-heatmap-weekday-labels');
  console.log(weekdayLabels);
  for (var elem of weekdayLabels) {
    elem.setAttribute('transform', 'translate(7, 14)');
  }

Please explain!

shivamka1 avatar Mar 26 '24 09:03 shivamka1

This because all elements are SVG, (even the text), this means that margin-* won't affect it... You second method is the way to go :]

felixmosh avatar Jan 05 '25 10:01 felixmosh