mirror of
https://github.com/apache/superset.git
synced 2026-04-24 10:35:01 +00:00
fix(plugin-chart-echarts): make to allow the custome of x & y axis title margin i… (#18947)
* fix(chartviz): make to allow the custome of x & y axis title margin in chart * fix(chartviz): add eslint radix error in chart.js * fix(chartviz): change the transformProps in chart plugin & creat helper. * fix(chartviz): lint fix & chart.js back * fix(plugin-chart-echarts): make to allow the custom margin of X & y axis in BoxPlot & Mixedtimeseries charts * fix(plugin-chart-echarts): make to change changeNumber to changeInteger * fix(plugin-chart-echarts): make to add license & change file name
This commit is contained in:
@@ -50,6 +50,7 @@ import {
|
||||
formatForecastTooltipSeries,
|
||||
rebaseForecastDatum,
|
||||
} from '../utils/forecast';
|
||||
import { convertInteger } from '../utils/convertInteger';
|
||||
import { defaultGrid, defaultTooltip, defaultYAxis } from '../defaults';
|
||||
import {
|
||||
getPadding,
|
||||
@@ -251,8 +252,8 @@ export default function transformProps(
|
||||
null,
|
||||
addXAxisTitleOffset,
|
||||
yAxisTitlePosition,
|
||||
yAxisTitleMargin,
|
||||
xAxisTitleMargin,
|
||||
convertInteger(yAxisTitleMargin),
|
||||
convertInteger(xAxisTitleMargin),
|
||||
);
|
||||
const labelMap = rawSeriesA.reduce((acc, datum) => {
|
||||
const label = datum.name as string;
|
||||
@@ -282,7 +283,7 @@ export default function transformProps(
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
name: xAxisTitle,
|
||||
nameGap: xAxisTitleMargin,
|
||||
nameGap: convertInteger(xAxisTitleMargin),
|
||||
nameLocation: 'middle',
|
||||
axisLabel: {
|
||||
formatter: xAxisFormatter,
|
||||
@@ -300,7 +301,7 @@ export default function transformProps(
|
||||
axisLabel: { formatter },
|
||||
scale: truncateYAxis,
|
||||
name: yAxisTitle,
|
||||
nameGap: yAxisTitleMargin,
|
||||
nameGap: convertInteger(yAxisTitleMargin),
|
||||
nameLocation: yAxisTitlePosition === 'Left' ? 'middle' : 'end',
|
||||
alignTicks,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user