fejn-kline
Version:
kline chart
217 lines (216 loc) • 4.44 kB
JavaScript
import { config } from "../utils";
export const propTypes = {
/** 支持的图表类型 */
types: {
type: Array,
default: () => ["simple", "tv"]
},
/** 图表类型 */
type: {
type: String,
default: "simple"
},
/** TradingView 包路径 */
libraryPath: {
type: String,
default: ""
},
/** TradingView 自定义 css 路径 */
customCssUrl: {
type: String,
default: "theme.css"
},
/** 缓存 key */
storeKey: {
type: String,
default: config.storeKey
},
/** 交易所名称 */
exchange: {
type: String,
default: ""
},
/** 水印 */
watermark: {
type: String,
defatult: ""
},
/** 主题 */
theme: {
type: String,
default: config.theme
},
/** 语言 */
lang: {
type: String,
default: config.lang
},
/** 默认展示 ma 指标 */
showMa: {
type: Boolean,
default: true
},
/** 默认展示成交量指标 */
showVol: {
type: Boolean,
default: true
},
/** 时间周期 */
interval: {
type: String,
default: config.interval
},
/** 支持的时间周期列表 */
intervals: {
type: Array,
default: () => config.intervals
},
/** 菜单已选时间区间 */
selectedIntervals: {
type: Array,
default: () => config.showIntervals
},
/** 图形 */
graph: {
type: Number,
default: 1
},
/** 全屏 */
fullscreen: {
type: Boolean,
default: false
},
/** 交易对 */
symbol: {
type: String,
default: ""
},
/** 价格精度 */
pricePrecision: {
type: Number,
default: 4
},
/** 数量精度 */
quantityPrecision: {
type: Number,
default: 4
},
/** 数据加载中 */
loading: {
type: Boolean,
default: true
},
/** loading 颜色 */
loadingColor: {
type: String,
default: "#f8b200"
},
/** 默认请求条数 */
limitSize: {
type: Number,
default: 1e3
}
};
export const menuProps = {
type: propTypes.type,
theme: propTypes.theme,
lang: propTypes.lang,
interval: propTypes.interval,
intervals: propTypes.intervals,
selectedIntervals: propTypes.selectedIntervals,
graph: propTypes.graph,
fullscreen: propTypes.fullscreen,
loading: propTypes.loading
};
export const tvProps = {
libraryPath: propTypes.libraryPath,
customCssUrl: propTypes.customCssUrl,
storeKey: propTypes.storeKey,
exchange: propTypes.exchange,
watermark: propTypes.watermark,
theme: propTypes.theme,
lang: propTypes.lang,
showMa: propTypes.showMa,
showVol: propTypes.showVol,
interval: propTypes.interval,
graph: propTypes.graph,
symbol: propTypes.symbol,
pricePrecision: propTypes.pricePrecision,
quantityPrecision: propTypes.quantityPrecision,
loading: propTypes.loading,
loadingColor: propTypes.loadingColor,
limitSize: propTypes.limitSize,
list: {
type: Array,
default: () => []
},
latestData: {
type: Object,
default: () => null
},
loadMore: {
type: Function,
default: () => {
}
}
};
export const simpleProps = {
storeKey: propTypes.storeKey,
watermark: propTypes.watermark,
theme: propTypes.theme,
lang: propTypes.lang,
showMa: propTypes.showMa,
showVol: propTypes.showVol,
graph: propTypes.graph,
pricePrecision: propTypes.pricePrecision,
quantityPrecision: propTypes.quantityPrecision,
loading: propTypes.loading,
loadingColor: propTypes.loadingColor,
limitSize: propTypes.limitSize,
list: {
type: Array,
default: () => []
},
latestData: {
type: Object,
default: () => null
},
loadMore: {
type: Function,
default: () => {
}
}
};
export const Kline = {
types: propTypes.types,
type: propTypes.type,
libraryPath: propTypes.libraryPath,
customCssUrl: propTypes.customCssUrl,
storeKey: propTypes.storeKey,
exchange: propTypes.exchange,
watermark: propTypes.watermark,
theme: propTypes.theme,
lang: propTypes.lang,
showMa: propTypes.showMa,
showVol: propTypes.showVol,
intervals: propTypes.intervals,
symbol: propTypes.symbol,
pricePrecision: propTypes.pricePrecision,
quantityPrecision: propTypes.quantityPrecision,
loading: propTypes.loading,
loadingColor: propTypes.loadingColor,
limitSize: propTypes.limitSize,
list: {
type: Array,
default: () => []
},
latestData: {
type: Object,
default: () => null
},
loadMore: {
type: Function,
default: () => {
}
}
};