Skip to content

Commit 0b04c71

Browse files
authored
Merge pull request #1252 from merico-dev/1250-update-default-chart-style-by-new-design
1250 update default chart style by new design
2 parents 21a1aa9 + 60099d9 commit 0b04c71

File tree

29 files changed

+176
-130
lines changed

29 files changed

+176
-130
lines changed

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/api",
3-
"version": "10.47.1",
3+
"version": "10.48.1",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/dashboard",
3-
"version": "10.47.1",
3+
"version": "10.48.1",
44
"license": "Apache-2.0",
55
"publishConfig": {
66
"access": "public",

dashboard/src/components/panel/panel-render/use-download-panel-screenshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function useDownloadPanelScreenshot(panel: PanelRenderModelInstance) {
2121
style: { border: 'none', borderRadius: 0, transformOrigin: '0 0', transform: 'scale(2)' },
2222
})
2323
.then((blob: string) => {
24-
window.saveAs(blob, `${panel.title ? panel.title : panel.viz.type}.png`);
24+
window.saveAs(blob, `${panel.name ? panel.name : panel.viz.type}.png`);
2525
});
2626
};
2727
return { ref, downloadPanelScreenshot };

dashboard/src/components/plugins/viz-components/boxplot-chart/option/index.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getSeries } from './series';
1010
import { getTooltip } from './tooltip';
1111
import { getReferenceLines } from './reference-line';
1212
import { getGrid } from './grid';
13+
import { defaultEchartsOptions } from '~/styles/default-echarts-options';
1314

1415
interface IGetOption {
1516
config: IBoxplotChartConf;
@@ -28,42 +29,31 @@ export function getOption({ config, data, variables }: IGetOption) {
2829
legend: getLegend({ config }),
2930
tooltip: getTooltip({ config }),
3031
xAxis: [
31-
{
32+
defaultEchartsOptions.getXAxis({
3233
type: 'category',
3334
name: x_axis.name,
3435
nameGap: 25,
3536
nameLocation: 'center',
3637
nameTextStyle: {
37-
fontWeight: 'bold',
3838
align: 'center',
3939
},
40-
axisTick: {
41-
show: true,
42-
alignWithLabel: true,
43-
},
4440
axisLabel: {
4541
...x_axis.axisLabel,
4642
...overflowOption,
4743
formatter: getEchartsXAxisLabel(x_axis.axisLabel.formatter),
4844
},
49-
},
45+
}),
5046
],
5147
yAxis: [
52-
{
48+
defaultEchartsOptions.getYAxis({
5349
name: y_axis.name,
5450
minInterval: 1,
55-
nameTextStyle: {
56-
fontWeight: 'bold',
57-
},
58-
axisLine: {
59-
show: true,
60-
},
6151
axisLabel: {
6252
formatter: function (value: number) {
6353
return numbro(value).format(y_axis.label_formatter);
6454
},
6555
},
66-
},
56+
}),
6757
],
6858
series: [...series, ...getReferenceLines(reference_lines, variables, data)],
6959
};

dashboard/src/components/plugins/viz-components/boxplot-chart/option/legend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function getLegend({ config }: { config: IBoxplotChartConf }) {
1515
name: 'Outlier',
1616
icon: 'circle',
1717
itemStyle: {
18-
color: '#2F8CC0',
18+
color: '#ED6A45',
1919
},
2020
},
2121
],

dashboard/src/components/plugins/viz-components/boxplot-chart/option/reference-line.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export function getReferenceLines(
2424
},
2525
],
2626
silent: true,
27-
symbol: ['none', 'none'],
27+
symbol: ['none', 'triangle'],
28+
symbolRotate: 90,
29+
symbolSize: [10, 8],
2830
label: {
2931
formatter: function () {
3032
return templateToString(r.template, variables, data);

dashboard/src/components/plugins/viz-components/boxplot-chart/option/series.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export function getSeries(conf: IBoxplotChartConf) {
2727
{
2828
name: 'Outlier',
2929
type: 'scatter',
30-
symbolSize: 5,
30+
symbolSize: 7,
3131
itemStyle: {
32-
color: '#2F8CC0',
32+
color: '#ED6A45',
3333
},
3434
emphasis: {
3535
scale: 2,

dashboard/src/components/plugins/viz-components/boxplot-chart/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const DEFAULT_CONFIG: IBoxplotChartConf = {
6969
tooltip: {
7070
metrics: [],
7171
},
72-
color: '#228be6',
72+
color: 'rgba(99, 152, 199, 0.10)',
7373
reference_lines: [],
7474
legend: {
7575
show: true,

dashboard/src/components/plugins/viz-components/cartesian/option/series/series_items.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export function getSeriesItemOrItems(
4545
},
4646
...rest,
4747
};
48+
if (rest.type === 'line') {
49+
seriesItem.lineStyle = {
50+
shadowColor: 'rgba(255,255,255,1)',
51+
shadowBlur: 0,
52+
shadowOffsetX: 0,
53+
shadowOffsetY: 3,
54+
};
55+
}
4856
if (display_name_on_line) {
4957
seriesItem.endLabel = {
5058
show: true,
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { getLabelOverflowOptionOnAxis } from '~/components/plugins/common-echarts-fields/axis-label-overflow';
2+
import { defaultEchartsOptions } from '~/styles/default-echarts-options';
23
import { getEchartsXAxisLabel } from '../editors/x-axis/x-axis-label-formatter/get-echarts-x-axis-tick-label';
34
import { ICartesianChartConf } from '../type';
45

@@ -7,21 +8,17 @@ export function getXAxes(conf: ICartesianChartConf, xAxisData: $TSFixMe[]) {
78
const overflowOption = getLabelOverflowOptionOnAxis(overflow.on_axis);
89
const xDataEmpty = xAxisData.length === 0;
910
return [
10-
{
11+
defaultEchartsOptions.getXAxis({
1112
data: xAxisData,
1213
name: conf.x_axis_name ?? '',
1314
nameGap: xDataEmpty ? 5 : undefined,
1415
id: 'main-x-axis',
15-
axisTick: {
16-
show: true,
17-
alignWithLabel: true,
18-
},
1916
type: conf.x_axis.type,
2017
axisLabel: {
2118
...axisLabel,
2219
...overflowOption,
2320
formatter: getEchartsXAxisLabel(axisLabel.formatter),
2421
},
25-
},
22+
}),
2623
];
2724
}

0 commit comments

Comments
 (0)