feat(chart): support configurable plot margins
All checks were successful
Package component / package (push) Successful in 7m2s

This commit is contained in:
李启源
2026-08-05 15:16:52 +08:00
parent fbf10fdb88
commit 9eb1f0f137
20 changed files with 184 additions and 16 deletions

View File

@@ -19,6 +19,7 @@ const {
overlayMode,
resolvedChartLeftMargin,
titleAreaHeight,
resolvedPlotMargin,
pointerInsideChart,
handleNativeContextMenu,
titleAreaReserved,
@@ -118,6 +119,8 @@ const {
:data-presentation-mode="isPresentationMode"
:data-overlay-mode="overlayMode"
:data-chart-left-margin="resolvedChartLeftMargin"
:data-plot-margin-top="resolvedPlotMargin.top"
:data-plot-margin-bottom="resolvedPlotMargin.bottom"
:data-title-area-height="titleAreaHeight"
@pointerenter="pointerInsideChart = true"
@pointerleave="pointerInsideChart = false"
@@ -287,18 +290,18 @@ const {
/>
</g>
</g>
<text
v-if="resolvedXLabel && !isCleanView"
class="waveform-chart__label waveform-chart__x-label"
:x="innerWidth / 2"
:y="xAxisTitleY"
text-anchor="middle"
>
{{ resolvedXLabel }}
</text>
</g>
<text
v-if="resolvedXLabel && !isCleanView"
class="waveform-chart__label waveform-chart__x-label"
:x="resolvedChartLeftMargin + innerWidth / 2"
:y="xAxisTitleY"
text-anchor="middle"
>
{{ resolvedXLabel }}
</text>
<text
v-if="hasChartArea && !hasWaveformData"
class="waveform-chart__empty"