Skip to content

Commit

Permalink
fix: rename style to stockStyle (#2621)
Browse files Browse the repository at this point in the history
Co-authored-by: liufu.lf <[email protected]>
  • Loading branch information
lxfu1 and liufu.lf authored Jun 9, 2021
1 parent e895e49 commit eaa2a58
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions __tests__/unit/plots/stock/style-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { createDiv } from '../../../utils/dom';
import { kdata } from '../../../data/stock';

describe('Stock', () => {
it('set style', () => {
it('set stock style', () => {
const k = new Stock(createDiv('x*y'), {
width: 400,
height: 500,
data: kdata,
xField: 'date',
yField: ['start', 'end', 'max', 'min'],
style: {
stockStyle: {
stroke: 'red',
lineWidth: 2,
},
Expand Down
6 changes: 3 additions & 3 deletions docs/api/plots/stock.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Configure the data source. The data source is a collection of objects. For examp
];
```

#### xField
#### xField

<description>**required** _string_</description>

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

#### yField
#### yField

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

Expand Down Expand Up @@ -83,7 +83,7 @@ Falling color configuration.

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

#### style
#### stockStyle

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

Expand Down
6 changes: 3 additions & 3 deletions docs/api/plots/stock.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ order: 18
];
```

#### xField
#### xField

<description>**required** _string_</description>

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

#### yField
#### yField

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

Expand Down Expand Up @@ -83,7 +83,7 @@ order: 18

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

#### style
#### stockStyle

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

Expand Down
2 changes: 1 addition & 1 deletion examples/more-plots/stock/demo/custom-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fetch('https://gw.alipayobjects.com/os/antfincdn/qtQ9nYfYJe/stock-data.json')
// 关闭 tooltip 悬浮内容
showContent: false,
},
style: {
stockStyle: {
stroke: '#666',
lineWidth: 0.5,
},
Expand Down
4 changes: 2 additions & 2 deletions src/plots/stock/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function geometry(params: Params<StockOptions>): Params<StockOptions> {
const { chart, options } = params;
const { yField } = options;

const { data, risingFill, fallingFill, tooltip, style } = options;
const { data, risingFill, fallingFill, tooltip, stockStyle } = options;

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

Expand All @@ -31,7 +31,7 @@ function geometry(params: Params<StockOptions>): Params<StockOptions> {
schema: {
shape: 'candle',
color: [risingFill, fallingFill],
style,
style: stockStyle,
},
yField: Y_FIELD,
seriesField: TREND_FIELD,
Expand Down
2 changes: 1 addition & 1 deletion src/plots/stock/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export interface StockOptions extends Options {
readonly fallingFill?: string;

/** 样式配置 */
readonly style?: StyleAttr;
readonly stockStyle?: StyleAttr;
}

0 comments on commit eaa2a58

Please sign in to comment.