Skip to content

Commit f71c1be

Browse files
authored
Merge pull request #2244 from scottsut/dev
fix: Bug fixes
2 parents df210f7 + 7db0d1f commit f71c1be

File tree

37 files changed

+889
-315
lines changed

37 files changed

+889
-315
lines changed

frontend/src/app/components/ChartDrill/ChartDrillContextMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const ChartDrillContextMenu: FC<{
8080
} else {
8181
rows = groupSection?.rows?.filter(v => v.uid === allFields[0].uid);
8282
}
83+
rows = rows?.filter(row => row.type === DataViewFieldType.DATE);
8384
return getRuntimeDateLevelFields(rows);
8485
}, [drillOption, chartConfig?.datas, currentFields]);
8586

frontend/src/app/components/ChartGraph/BasicBarChart/BasicBarChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class BasicBarChart extends Chart implements IChartLifecycle {
242242
return {
243243
tooltip: {
244244
trigger: 'item',
245+
confine: true,
245246
formatter: this.getTooltipFormatterFunc(
246247
chartDataSet,
247248
groupConfigs,

frontend/src/app/components/ChartGraph/BasicDoubleYChart/BasicDoubleYChart.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class BasicDoubleYChart extends Chart {
180180
axisPointer: {
181181
type: 'cross',
182182
},
183+
confine: true,
183184
formatter: this.getTooltipFormmaterFunc(
184185
styleConfigs,
185186
groupConfigs,
@@ -365,10 +366,10 @@ class BasicDoubleYChart extends Chart {
365366
);
366367

367368
const _yAxisTemplate = (position, name): DoubleYChartYAxis => {
368-
const [showAxis, inverse, font, showLabel] = getStyles(
369+
const [showAxis, inverse, font, showLabel, showTitleAndUnit] = getStyles(
369370
styles,
370371
[`${position}Y`],
371-
['showAxis', 'inverseAxis', 'font', 'showLabel'],
372+
['showAxis', 'inverseAxis', 'font', 'showLabel', 'showTitleAndUnit'],
372373
);
373374
const [format] = getStyles(
374375
styles,
@@ -379,7 +380,7 @@ class BasicDoubleYChart extends Chart {
379380
type: 'value',
380381
position,
381382
showTitleAndUnit: true,
382-
name,
383+
name: showTitleAndUnit ? name : null,
383384
nameLocation: 'middle',
384385
nameGap: 50,
385386
nameRotate: 90,

frontend/src/app/components/ChartGraph/BasicDoubleYChart/config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ const config: ChartConfig = {
253253
color: '#495057',
254254
},
255255
},
256+
{
257+
label: 'common.showTitleAndUnit',
258+
key: 'showTitleAndUnit',
259+
default: true,
260+
comType: 'checkbox',
261+
},
256262
{
257263
label: 'yAxis.open',
258264
key: 'modal',
@@ -331,6 +337,12 @@ const config: ChartConfig = {
331337
color: '#495057',
332338
},
333339
},
340+
{
341+
label: 'common.showTitleAndUnit',
342+
key: 'showTitleAndUnit',
343+
default: true,
344+
comType: 'checkbox',
345+
},
334346
{
335347
label: 'yAxis.open',
336348
key: 'modal',

frontend/src/app/components/ChartGraph/BasicLineChart/BasicLineChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ class BasicLineChart extends Chart {
212212
return {
213213
tooltip: {
214214
trigger: 'item',
215+
confine: true,
215216
formatter: this.getTooltipFormmaterFunc(
216217
chartDataSet,
217218
groupConfigs,

frontend/src/app/components/ChartGraph/BasicOutlineMapChart/BasicOutlineMapChart.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,22 @@ class BasicOutlineMapChart extends Chart {
291291
areaEmphasisColor,
292292
enableFocus,
293293
borderStyle,
294+
roam,
294295
] = getStyles(
295296
styleConfigs,
296297
['map'],
297-
['level', 'areaColor', 'areaEmphasisColor', 'focusArea', 'borderStyle'],
298+
[
299+
'level',
300+
'areaColor',
301+
'areaEmphasisColor',
302+
'focusArea',
303+
'borderStyle',
304+
'roam',
305+
],
298306
);
299307
return {
300308
map: mapLevelName,
301-
roam: 'move',
309+
roam: roam && 'move',
302310
emphasis: {
303311
focus: enableFocus ? 'self' : 'none',
304312
itemStyle: {

frontend/src/app/components/ChartGraph/BasicPieChart/BasicPieChart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,11 @@ class BasicPieChart extends Chart {
243243
}
244244

245245
private getPieSeriesImpl(styleConfigs: ChartStyleConfig[]): PieSeriesImpl {
246+
const [avoidOverlap] = getStyles(styleConfigs, ['label'], ['avoidOverlap']);
246247
return {
247248
type: 'pie',
248249
sampling: 'average',
249-
avoidLabelOverlap: false,
250+
avoidLabelOverlap: avoidOverlap,
250251
...this.getLabelStyle(styleConfigs),
251252
...this.getSeriesStyle(styleConfigs),
252253
...getGridStyle(styleConfigs),

frontend/src/app/components/ChartGraph/BasicPieChart/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ const config: ChartConfig = {
111111
default: true,
112112
comType: 'checkbox',
113113
},
114+
{
115+
label: 'label.avoidOverlap',
116+
key: 'avoidOverlap',
117+
default: false,
118+
comType: 'checkbox',
119+
},
114120
],
115121
},
116122
{
@@ -284,6 +290,7 @@ const config: ChartConfig = {
284290
showName: '维度值',
285291
showPercent: '百分比',
286292
showValue: '指标值',
293+
avoidOverlap: '强制显示所有标签',
287294
},
288295
legend: {
289296
title: '图例',
@@ -333,6 +340,7 @@ const config: ChartConfig = {
333340
showName: 'Show Name',
334341
showPercent: 'Show Percentage',
335342
showValue: 'Show Value',
343+
avoidOverlap: 'Force display of all labels',
336344
},
337345
legend: {
338346
title: 'Legend',

frontend/src/app/components/ChartGraph/BasicTableChart/AntdTableWrapper.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
* limitations under the License.
1717
*/
1818

19-
import { Table } from 'antd';
19+
import { ConfigProvider, Table } from 'antd';
20+
import { antdLocales } from 'locales/i18n';
2021
import { FC, memo } from 'react';
22+
import { useTranslation } from 'react-i18next';
2123
import styled from 'styled-components/macro';
2224

2325
interface TableStyleConfigProps {
@@ -47,6 +49,8 @@ const AntdTableWrapper: FC<{
4749
summaryFn?: (data) => { total: number; summarys: [] };
4850
}> = memo(
4951
({ dataSource, columns, children, summaryFn, tableStyleConfig, ...rest }) => {
52+
const { i18n } = useTranslation();
53+
5054
const getTableSummaryRow = pageData => {
5155
if (!summaryFn) {
5256
return undefined;
@@ -68,13 +72,15 @@ const AntdTableWrapper: FC<{
6872
};
6973

7074
return (
71-
<StyledTable
72-
{...rest}
73-
tableStyleConfig={tableStyleConfig}
74-
dataSource={dataSource}
75-
columns={columns}
76-
summary={getTableSummaryRow}
77-
/>
75+
<ConfigProvider locale={antdLocales[i18n.language]}>
76+
<StyledTable
77+
{...rest}
78+
tableStyleConfig={tableStyleConfig}
79+
dataSource={dataSource}
80+
columns={columns}
81+
summary={getTableSummaryRow}
82+
/>
83+
</ConfigProvider>
7884
);
7985
},
8086
);

frontend/src/app/components/ChartGraph/NormalOutlineMapChart/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ const config: ChartConfig = {
9797
color: '#ced4da',
9898
},
9999
},
100+
{
101+
label: 'map.roam',
102+
key: 'roam',
103+
default: true,
104+
comType: 'checkbox',
105+
},
100106
],
101107
},
102108
{
@@ -310,6 +316,7 @@ const config: ChartConfig = {
310316
focusArea: '聚焦选中区域',
311317
areaColor: '区域颜色',
312318
areaEmphasisColor: '选中区域高亮颜色',
319+
roam: '鼠标平移',
313320
},
314321
levelType: {
315322
china: '中国-省级地图',
@@ -362,6 +369,7 @@ const config: ChartConfig = {
362369
focusArea: 'Focus Area',
363370
areaColor: 'Area Color',
364371
areaEmphasisColor: 'Area Emphasis Color',
372+
roam: 'Mouse translating',
365373
},
366374
levelType: {
367375
china: 'China',

0 commit comments

Comments
 (0)