mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
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:
@@ -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) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
text-align: center;
|
||||
padding: 15px 10px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.counter-visualization-content {
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user