fix(dashboard-v2): bound graph labels to the container box
This commit is contained in:
parent
d093577909
commit
2e7bccf604
|
@ -12,11 +12,13 @@ const BarTip = styled.span.attrs({
|
||||||
})``;
|
})``;
|
||||||
|
|
||||||
const BarLabel = styled.span.attrs({
|
const BarLabel = styled.span.attrs({
|
||||||
className: "bg-white rounded border-2 border-palette-200 px-3 whitespace-nowrap absolute shadow",
|
className: "usage-label bg-white rounded border-2 border-palette-200 px-3 whitespace-nowrap absolute shadow",
|
||||||
})`
|
})`
|
||||||
right: max(0%, ${({ $percentage }) => 100 - $percentage}%);
|
${({ $percentage }) => `
|
||||||
top: -0.5rem;
|
left: max(0%, ${$percentage}%);
|
||||||
transform: translateX(50%);
|
top: -0.5rem;
|
||||||
|
transform: translateX(-${$percentage}%);
|
||||||
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const GraphBar = ({ value, limit, label }) => {
|
export const GraphBar = ({ value, limit, label }) => {
|
||||||
|
|
Reference in New Issue