|
|
@@ -71,7 +71,7 @@ export function useOptions(dataset: EchartsDataset) {
|
|
|
}
|
|
|
|
|
|
const initOptions = () => {
|
|
|
- const { timeline, maxMark, minMark, interval, yestclose, decimal } = dataset;
|
|
|
+ const { timeline, maxMark, minMark, interval, yestclose, precision } = dataset;
|
|
|
const { colors } = options;
|
|
|
|
|
|
options.timeline = {
|
|
|
@@ -85,7 +85,7 @@ export function useOptions(dataset: EchartsDataset) {
|
|
|
},
|
|
|
axisPointer: {
|
|
|
label: {
|
|
|
- precision: decimal, // 小数点精度
|
|
|
+ precision,
|
|
|
backgroundColor: 'rgba(128,128,128,.75)',
|
|
|
}
|
|
|
},
|
|
|
@@ -107,10 +107,10 @@ export function useOptions(dataset: EchartsDataset) {
|
|
|
min: minMark,
|
|
|
interval,
|
|
|
axisLabel: {
|
|
|
- formatter: (val: number) => val.toFixed(decimal),
|
|
|
+ formatter: (val: number) => val.toFixed(precision),
|
|
|
color: (val) => {
|
|
|
if (val) {
|
|
|
- const num = Number(val).toFixed(decimal);
|
|
|
+ const num = Number(val).toFixed(precision);
|
|
|
if (Number(num) > yestclose) return colors.upColor;
|
|
|
if (Number(num) < yestclose) return colors.downColor;
|
|
|
}
|
|
|
@@ -133,7 +133,7 @@ export function useOptions(dataset: EchartsDataset) {
|
|
|
formatter: (val: number) => calcRatio(val),
|
|
|
color: (val) => {
|
|
|
if (val) {
|
|
|
- const num = Number(val).toFixed(decimal);
|
|
|
+ const num = Number(val).toFixed(precision);
|
|
|
if (Number(num) > yestclose) return colors.upColor;
|
|
|
if (Number(num) < yestclose) return colors.downColor;
|
|
|
}
|
|
|
@@ -181,6 +181,7 @@ export function useOptions(dataset: EchartsDataset) {
|
|
|
type: 'dashed',
|
|
|
color: 'rgba(128,128,128,.3)'
|
|
|
},
|
|
|
+ precision,
|
|
|
data: [
|
|
|
{
|
|
|
yAxis: timeline.source.close[timeline.source.close.length - 1] ?? '--', // 最新价
|