@opendata-ai/openchart-vanilla 7.2.0 → 7.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5259,7 +5259,7 @@ function renderAnnotations(parent, layout) {
5259
5259
 
5260
5260
  // src/renderers/axes.ts
5261
5261
  import {
5262
- AXIS_TITLE_GAP,
5262
+ axisTitleOffset,
5263
5263
  estimateTextWidth as estimateTextWidth2,
5264
5264
  getAxisTitleOffset,
5265
5265
  TICK_LABEL_OFFSET
@@ -5318,7 +5318,8 @@ function renderAxis(parent, axis, orientation, layout) {
5318
5318
  setAttrs2(label, {
5319
5319
  x: tick.position,
5320
5320
  y: area.y + area.height + xLabelPad,
5321
- "text-anchor": "middle"
5321
+ "text-anchor": "middle",
5322
+ "dominant-baseline": "hanging"
5322
5323
  });
5323
5324
  }
5324
5325
  applyTextStyle(label, axis.tickLabelStyle);
@@ -5484,8 +5485,11 @@ function renderAxis(parent, axis, orientation, layout) {
5484
5485
  );
5485
5486
  return Math.max(max, w);
5486
5487
  }, 0);
5487
- const dynamicOffset = TICK_LABEL_OFFSET + maxTickLabelWidth + AXIS_TITLE_GAP;
5488
- const titleOffset = Math.max(dynamicOffset, getAxisTitleOffset(layout.dimensions.width));
5488
+ const titleOffset = axisTitleOffset(
5489
+ maxTickLabelWidth,
5490
+ axis.labelStyle.fontSize,
5491
+ layout.dimensions.width
5492
+ );
5489
5493
  setAttrs2(axisLabel, {
5490
5494
  x: area.x - titleOffset,
5491
5495
  y: area.y + area.height / 2,