Skip to content

Commit eaa2a58

Browse files
lxfu1liufu.lf
and
liufu.lf
authored
fix: rename style to stockStyle (#2621)
Co-authored-by: liufu.lf <[email protected]>
1 parent e895e49 commit eaa2a58

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

__tests__/unit/plots/stock/style-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { createDiv } from '../../../utils/dom';
33
import { kdata } from '../../../data/stock';
44

55
describe('Stock', () => {
6-
it('set style', () => {
6+
it('set stock style', () => {
77
const k = new Stock(createDiv('x*y'), {
88
width: 400,
99
height: 500,
1010
data: kdata,
1111
xField: 'date',
1212
yField: ['start', 'end', 'max', 'min'],
13-
style: {
13+
stockStyle: {
1414
stroke: 'red',
1515
lineWidth: 2,
1616
},

docs/api/plots/stock.en.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Configure the data source. The data source is a collection of objects. For examp
4040
];
4141
```
4242

43-
#### xField
43+
#### xField
4444

4545
<description>**required** _string_</description>
4646

@@ -51,7 +51,7 @@ Configure the data source. The data source is a collection of objects. For examp
5151
- 时间戳,如 1436237115500;
5252
- 时间字符串: '2015-03-01','2015-03-01 12:01:40','2015/01/05','2015-03-01T16:00:00.000Z'。
5353

54-
#### yField
54+
#### yField
5555

5656
<description>**required** _array string_</description>
5757

@@ -83,7 +83,7 @@ Falling color configuration.
8383

8484
<playground path="more-plots/stock/demo/custom-color.ts" rid="custom-color"></playground>
8585

86-
#### style
86+
#### stockStyle
8787

8888
<description>**optional** _StyleAttr | Function_</description>
8989

docs/api/plots/stock.zh.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ order: 18
4040
];
4141
```
4242

43-
#### xField
43+
#### xField
4444

4545
<description>**required** _string_</description>
4646

@@ -51,7 +51,7 @@ order: 18
5151
- 时间戳,如 1436237115500;
5252
- 时间字符串: '2015-03-01','2015-03-01 12:01:40','2015/01/05','2015-03-01T16:00:00.000Z'。
5353

54-
#### yField
54+
#### yField
5555

5656
<description>**required** _array string_</description>
5757

@@ -83,7 +83,7 @@ order: 18
8383

8484
<playground path="more-plots/stock/demo/custom-color.ts" rid="custom-color"></playground>
8585

86-
#### style
86+
#### stockStyle
8787

8888
<description>**可选** _StyleAttr | Function_</description>
8989

examples/more-plots/stock/demo/custom-style.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/qtQ9nYfYJe/stock-data.json')
1111
// 关闭 tooltip 悬浮内容
1212
showContent: false,
1313
},
14-
style: {
14+
stockStyle: {
1515
stroke: '#666',
1616
lineWidth: 0.5,
1717
},

src/plots/stock/adaptor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function geometry(params: Params<StockOptions>): Params<StockOptions> {
1616
const { chart, options } = params;
1717
const { yField } = options;
1818

19-
const { data, risingFill, fallingFill, tooltip, style } = options;
19+
const { data, risingFill, fallingFill, tooltip, stockStyle } = options;
2020

2121
chart.data(getStockData(data, yField));
2222

@@ -31,7 +31,7 @@ function geometry(params: Params<StockOptions>): Params<StockOptions> {
3131
schema: {
3232
shape: 'candle',
3333
color: [risingFill, fallingFill],
34-
style,
34+
style: stockStyle,
3535
},
3636
yField: Y_FIELD,
3737
seriesField: TREND_FIELD,

src/plots/stock/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export interface StockOptions extends Options {
1414
readonly fallingFill?: string;
1515

1616
/** 样式配置 */
17-
readonly style?: StyleAttr;
17+
readonly stockStyle?: StyleAttr;
1818
}

0 commit comments

Comments
 (0)