@opendata-ai/openchart-vanilla 7.1.4 → 7.2.1
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 +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/renderers/axes.ts +4 -2
package/dist/index.js
CHANGED
|
@@ -5304,7 +5304,8 @@ function renderAxis(parent, axis, orientation, layout) {
|
|
|
5304
5304
|
label.setAttribute("class", "oc-axis-tick");
|
|
5305
5305
|
if (axis.tickAngle && Math.abs(axis.tickAngle) > 10) {
|
|
5306
5306
|
const labelX = tick.position;
|
|
5307
|
-
const
|
|
5307
|
+
const xLabelPad = axis.labelPadding ?? layout.theme.spacing.xAxisLabelPadding;
|
|
5308
|
+
const labelY = area.y + area.height + xLabelPad;
|
|
5308
5309
|
setAttrs2(label, {
|
|
5309
5310
|
x: labelX,
|
|
5310
5311
|
y: labelY,
|
|
@@ -5313,9 +5314,10 @@ function renderAxis(parent, axis, orientation, layout) {
|
|
|
5313
5314
|
transform: `rotate(${axis.tickAngle}, ${labelX}, ${labelY})`
|
|
5314
5315
|
});
|
|
5315
5316
|
} else {
|
|
5317
|
+
const xLabelPad = axis.labelPadding ?? layout.theme.spacing.xAxisLabelPadding;
|
|
5316
5318
|
setAttrs2(label, {
|
|
5317
5319
|
x: tick.position,
|
|
5318
|
-
y: area.y + area.height +
|
|
5320
|
+
y: area.y + area.height + xLabelPad,
|
|
5319
5321
|
"text-anchor": "middle"
|
|
5320
5322
|
});
|
|
5321
5323
|
}
|