diff --git a/src/components/d3/monitoring/D3HorizontalCursor.tsx b/src/components/d3/monitoring/D3HorizontalCursor.tsx index af75ff0..70ff1c3 100644 --- a/src/components/d3/monitoring/D3HorizontalCursor.tsx +++ b/src/components/d3/monitoring/D3HorizontalCursor.tsx @@ -28,6 +28,7 @@ export type D3HorizontalCursorProps = D3HorizontalCursorSettings + spaceBetweenGroups?: number } const defaultLineStyle: SVGProps = { @@ -62,7 +63,7 @@ const makeDefaultRender = (): D3GroupRenderFunction => (gro ) const _D3HorizontalCursor = ({ - width = 220, + spaceBetweenGroups = 30, height = 200, render = makeDefaultRender(), position: _position = 'bottom', @@ -178,19 +179,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/pages/Telemetry/Archive/index.jsx b/src/pages/Telemetry/Archive/index.jsx index 4db24f0..7a0d65e 100755 --- a/src/pages/Telemetry/Archive/index.jsx +++ b/src/pages/Telemetry/Archive/index.jsx @@ -255,7 +255,6 @@ const Archive = memo(() => { plugins={{ menu: { enabled: false }, cursor: { - width: 220, render: cursorRender, } }} diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index 884b23c..9a03fba 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -295,7 +295,6 @@ const TelemetryView = memo(() => { plugins={{ menu: { enabled: false }, cursor: { - width: 220, render: cursorRender, }, }} diff --git a/src/styles/d3.less b/src/styles/d3.less index 6ec1bb0..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; @@ -110,3 +115,34 @@ height: 100%; } } + +@media (max-width: 1800px) { + .asb-d3-chart .adaptive-tooltip { + font-size: 11px; + } +} + +@media (max-width: 1600px) { + .asb-d3-chart .adaptive-tooltip { + font-size: 9px; + } +} + +@media (max-width: 1440px) { + .asb-d3-chart .adaptive-tooltip { + font-size: 8px; + padding: 0; + } +} + +@media (max-width: 1310px) { + .asb-d3-chart .adaptive-tooltip { + font-size: 7px; + } +} + +@media (max-width: 1279px) { + .asb-d3-chart .adaptive-tooltip { + font-size: 6px; + } +} \ No newline at end of file