mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +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:
@@ -36,6 +36,7 @@ import {
|
||||
getColtypesMapping,
|
||||
sanitizeHtml,
|
||||
} from '../utils/series';
|
||||
import { convertInteger } from '../utils/convertInteger';
|
||||
import { defaultGrid, defaultTooltip, defaultYAxis } from '../defaults';
|
||||
import { getPadding } from '../Timeseries/transformers';
|
||||
import { OpacityEnum } from '../constants';
|
||||
@@ -240,8 +241,8 @@ export default function transformProps(
|
||||
null,
|
||||
addXAxisTitleOffset,
|
||||
yAxisTitlePosition,
|
||||
yAxisTitleMargin,
|
||||
xAxisTitleMargin,
|
||||
convertInteger(yAxisTitleMargin),
|
||||
convertInteger(xAxisTitleMargin),
|
||||
);
|
||||
const echartOptions: EChartsCoreOption = {
|
||||
grid: {
|
||||
@@ -253,7 +254,7 @@ export default function transformProps(
|
||||
data: transformedData.map(row => row.name),
|
||||
axisLabel,
|
||||
name: xAxisTitle,
|
||||
nameGap: xAxisTitleMargin,
|
||||
nameGap: convertInteger(xAxisTitleMargin),
|
||||
nameLocation: 'middle',
|
||||
},
|
||||
yAxis: {
|
||||
@@ -261,7 +262,7 @@ export default function transformProps(
|
||||
type: 'value',
|
||||
axisLabel: { formatter: numberFormatter },
|
||||
name: yAxisTitle,
|
||||
nameGap: yAxisTitleMargin,
|
||||
nameGap: convertInteger(yAxisTitleMargin),
|
||||
nameLocation: yAxisTitlePosition === 'Left' ? 'middle' : 'end',
|
||||
},
|
||||
tooltip: {
|
||||
|
||||
Reference in New Issue
Block a user