Specify counter widgets font size in pt (#6537)

- prevent scrollbars from appearing
- start with a base font size of 12pt for more even scaling

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
This commit is contained in:
Eric Radman
2023-10-18 22:35:58 -04:00
committed by GitHub
parent 8bb1767c69
commit 593b6ae6ed
2 changed files with 4 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import "./render.less";
function getCounterStyles(scale: any) {
return {
fontSize: `${scale}px`,
fontSize: `${scale}pt`,
};
}
@@ -20,8 +20,8 @@ function getCounterScale(container: any) {
if (container.closest('.visualization-preview') || container.closest('.ant-tabs-tabpane')) {
return "60";
}
const fontSize = container.clientHeight / 4.5;
return fontSize > 60 ? "60" : fontSize < 14 ? "14" : fontSize.toFixed();
const fontSize = 12 + container.clientHeight / 5;
return fontSize > 60 ? "60" : fontSize.toFixed();
}
export default function Renderer({ data, options, visualizationName }: any) {

View File

@@ -3,6 +3,7 @@
text-align: center;
padding: 15px 10px;
position: relative;
overflow: hidden;
.counter-visualization-content {
margin: 0;