|
|
@@ -20,10 +20,11 @@ const props = defineProps({
|
|
|
goodsCode: {
|
|
|
type: String,
|
|
|
required: true
|
|
|
- }
|
|
|
+ },
|
|
|
+ makretId: Number
|
|
|
})
|
|
|
|
|
|
-const { getTSDataAsync, timeSplit, handleXAxisScale, networkFilter, updateLastData } = useDataset(props.goodsCode)
|
|
|
+const { getTSDataAsync, timeSplit, handleXAxisScale, networkFilter, updateLastData } = useDataset(props.goodsCode, props.makretId)
|
|
|
const { quoteWatch, getGoodsQuote } = useFuturesStore()
|
|
|
const goods = getGoodsQuote(props.goodsCode)
|
|
|
const chartInstance = shallowRef() // 图表实例
|
|
|
@@ -41,8 +42,8 @@ const chartOption = {
|
|
|
IsShowCorssCursorInfo: true,
|
|
|
DayCount: 1,
|
|
|
Border: {
|
|
|
- Left: 80,
|
|
|
- Right: 80,
|
|
|
+ Left: 30,
|
|
|
+ Right: 30,
|
|
|
Top: 30,
|
|
|
Bottom: 25,
|
|
|
AutoLeft: { Blank: 15, MinWidth: 30 },
|
|
|
@@ -56,7 +57,9 @@ const chartOption = {
|
|
|
IsShowName: false, // 不显示股票名称
|
|
|
},
|
|
|
Frame: [
|
|
|
- {}
|
|
|
+ {
|
|
|
+ IsShowRightText: !!goods.value?.presettle // 是否显示Y轴右侧刻度
|
|
|
+ }
|
|
|
],
|
|
|
OnCreatedCallback: (chart: MinuteChartContainer) => {
|
|
|
const paint = chart.TitlePaint[0]
|
|
|
@@ -65,9 +68,9 @@ const chartOption = {
|
|
|
const decimalplace = goods.value?.decimalplace
|
|
|
// 自定义标题栏,参考源码 DynamicMinuteTitlePainting.GetFormatTitle
|
|
|
paint.GetFormatTitle = (data) => {
|
|
|
- const { DateTime, Open, Close, Vol, Amount, YClose, Increase } = data.Data
|
|
|
+ const { DateTime, Open, Close, Vol, Amount, YClose, Increase = 0 } = data.Data
|
|
|
const AryText = [
|
|
|
- { Text: FormatDateTimeString(DateTime, paint.IsShowDate, paint.IsShowTime), Color: paint.DateTimeColor },
|
|
|
+ { Text: FormatDateTimeString(DateTime, true, paint.IsShowTime), Color: paint.DateTimeColor },
|
|
|
{ Text: '价:' + handleNumberValue(Close.toFixed(decimalplace)), Color: paint.GetColor(Open, YClose) },
|
|
|
{ Text: '幅:' + Increase.toFixed(2) + '%', Color: paint.GetColor(Increase, 0) }
|
|
|
]
|