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:
smileydev
2022-03-10 06:59:07 -05:00
committed by GitHub
parent 999c2c6826
commit c79ee56884
4 changed files with 38 additions and 12 deletions

View File

@@ -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: {