diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index eb1e7e2..afae24c 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -13,7 +13,7 @@ import '@styles/d3.less' type D3GroupRenderFunction = (group: ChartGroup, data: DataType[]) => ReactNode export type D3HorizontalCursorSettings = { - width?: number + spaceBetweenGroups?: number height?: number render?: D3GroupRenderFunction position?: D3TooltipPosition @@ -62,7 +62,7 @@ const makeDefaultRender = (): D3GroupRenderFunction => (gro ) const _D3HorizontalCursor = ({ - width = 220, + spaceBetweenGroups = 30, height = 200, render = makeDefaultRender(), position: _position = 'bottom', @@ -178,19 +178,21 @@ const _D3HorizontalCursor = ({ {groups.map((_, i) => ( -
-
- {tooltipBodies[i]} +
+
+
+ {tooltipBodies[i]} +
diff --git a/src/components/d3/monitoring/D3MonitoringCharts.tsx b/src/components/d3/monitoring/D3MonitoringCharts.tsx index a0b939e..078cb64 100644 --- a/src/components/d3/monitoring/D3MonitoringCharts.tsx +++ b/src/components/d3/monitoring/D3MonitoringCharts.tsx @@ -567,6 +567,7 @@ const _D3MonitoringCharts = >({ yAxis={yAxis} groups={groups} sizes={sizes} + spaceBetweenGroups={spaceBetweenGroups} data={data} height={height} /> diff --git a/src/styles/d3.less b/src/styles/d3.less index 62ca5c7..c009c17 100644 --- a/src/styles/d3.less +++ b/src/styles/d3.less @@ -2,12 +2,17 @@ width: 100%; height: 100%; + & .tooltip-wrapper { + display: flex; + justify-content: center; + } + & .tooltip { @color: white; @bg-color: rgba(0, 0, 0, .75); @arrow-size: 8px; - width: 100%; + max-width: 100%; height: 100%; font-size: 13px; @@ -109,51 +114,35 @@ width: 100%; height: 100%; } - - & .adaptive-tooltip { - left: 0; - right: 0; - margin: 0 auto; - } } -@media (max-width: 1830px) { +@media (max-width: 1800px) { .asb-d3-chart .adaptive-tooltip { - max-width: 190px; - font-size: 10px; + font-size: 11px; } } @media (max-width: 1600px) { .asb-d3-chart .adaptive-tooltip { - max-width: 160px; - font-size: 8px; + font-size: 9px; } } -@media (max-width: 1420px) { +@media (max-width: 1440px) { .asb-d3-chart .adaptive-tooltip { - max-width: 140px; - font-size: 7px; + font-size: 8px; padding: 0; } } -@media (max-width: 1300px) { +@media (max-width: 1310px) { .asb-d3-chart .adaptive-tooltip { - max-width: 125px; + font-size: 7px; } } -@media (max-width: 1200px) { +@media (max-width: 1279px) { .asb-d3-chart .adaptive-tooltip { - max-width: 105px; font-size: 6px; } -} - -@media (max-width: 1100px) { - .asb-d3-chart .adaptive-tooltip { - max-width: 90px; - } } \ No newline at end of file