Skip to content

Commit

Permalink
修改默认配置
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Apr 8, 2020
1 parent b693bc8 commit 73556a0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
9 changes: 7 additions & 2 deletions dist/klinecharts.development.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/klinecharts.development.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/klinecharts.production.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/data/ChartData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const GraphicMarkType = {
}

const MAX_DATA_SPACE = 30
const MIN_DATA_SPACE = 2
const MIN_DATA_SPACE = 3

export default class ChartData {
constructor (styleOptions, invalidateHandler) {
Expand Down Expand Up @@ -67,7 +67,7 @@ export default class ChartData {
// 绘制区间数据数量
this._range = 0
// 每一条数据的空间
this._dataSpace = 4
this._dataSpace = 8
// bar的空间
this._barSpace = this._calcBarSpace()

Expand Down
8 changes: 8 additions & 0 deletions src/series/ChartSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ export default class ChartSeries {
* @returns {string}
*/
createTechnicalIndicator (technicalIndicatorType, height = DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT) {
if (
!technicalIndicatorType ||
!TechnicalIndicatorType.hasOwnProperty(technicalIndicatorType) ||
technicalIndicatorType === TechnicalIndicatorType.NO ||
technicalIndicatorType === TechnicalIndicatorType.AVERAGE
) {
technicalIndicatorType = TechnicalIndicatorType.MACD
}
const technicalIndicatorSeriesCount = this._technicalIndicatorSeries.length
this._separatorSeries.push(
new SeparatorSeries(
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface Chart {
setCandleStickChartType(chartType: ChartType): void;
setCandleStickTechnicalIndicatorType(technicalIndicatorType: TechnicalIndicatorType): void;
setTechnicalIndicatorType(tag: string, technicalIndicatorType: TechnicalIndicatorType): void;
addTechnicalIndicator(technicalIndicatorType: TechnicalIndicatorType, height?: number): void;
addTechnicalIndicator(technicalIndicatorType?: TechnicalIndicatorType, height?: number): string;
removeTechnicalIndicator(tag: string): void;
addGraphicMark(graphicMarkType: GraphicMarkType): void;
removeAllGraphicMark(): void;
Expand Down

0 comments on commit 73556a0

Please sign in to comment.