feat: 添加 Props 类型
This commit is contained in:
@@ -150,10 +150,10 @@ export const useEventMarker = (
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (markerId) {
|
if (markerId) {
|
||||||
chart.removeOverlay(markerId);
|
chart.removeOverlay({ id: markerId } as any);
|
||||||
}
|
}
|
||||||
if (highlightId) {
|
if (highlightId) {
|
||||||
chart.removeOverlay(highlightId);
|
chart.removeOverlay({ id: highlightId } as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
setMarker(null);
|
setMarker(null);
|
||||||
@@ -216,10 +216,10 @@ export const useEventMarker = (
|
|||||||
if (chart) {
|
if (chart) {
|
||||||
try {
|
try {
|
||||||
if (markerId) {
|
if (markerId) {
|
||||||
chart.removeOverlay(markerId);
|
chart.removeOverlay({ id: markerId } as any);
|
||||||
}
|
}
|
||||||
if (highlightId) {
|
if (highlightId) {
|
||||||
chart.removeOverlay(highlightId);
|
chart.removeOverlay({ id: highlightId } as any);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 忽略清理时的错误
|
// 忽略清理时的错误
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export const createIndicator = (
|
|||||||
*/
|
*/
|
||||||
export const removeIndicator = (chart: Chart, indicatorId?: string): void => {
|
export const removeIndicator = (chart: Chart, indicatorId?: string): void => {
|
||||||
safeChartOperation('removeIndicator', () => {
|
safeChartOperation('removeIndicator', () => {
|
||||||
chart.removeIndicator(indicatorId);
|
chart.removeIndicator(indicatorId ? { id: indicatorId } as any : undefined);
|
||||||
logger.debug('chartUtils', '移除技术指标 (removeIndicator)', { indicatorId });
|
logger.debug('chartUtils', '移除技术指标 (removeIndicator)', { indicatorId });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -271,7 +271,7 @@ export const subscribeChartEvent = (
|
|||||||
handler: (...args: any[]) => void
|
handler: (...args: any[]) => void
|
||||||
): void => {
|
): void => {
|
||||||
safeChartOperation(`subscribeChartEvent:${eventName}`, () => {
|
safeChartOperation(`subscribeChartEvent:${eventName}`, () => {
|
||||||
chart.subscribeAction(eventName, handler);
|
chart.subscribeAction(eventName as any, handler);
|
||||||
logger.debug('chartUtils', '订阅图表事件 (subscribeChartEvent)', { eventName });
|
logger.debug('chartUtils', '订阅图表事件 (subscribeChartEvent)', { eventName });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -289,7 +289,7 @@ export const unsubscribeChartEvent = (
|
|||||||
handler: (...args: any[]) => void
|
handler: (...args: any[]) => void
|
||||||
): void => {
|
): void => {
|
||||||
safeChartOperation(`unsubscribeChartEvent:${eventName}`, () => {
|
safeChartOperation(`unsubscribeChartEvent:${eventName}`, () => {
|
||||||
chart.unsubscribeAction(eventName, handler);
|
chart.unsubscribeAction(eventName as any, handler);
|
||||||
logger.debug('chartUtils', '取消订阅图表事件 (unsubscribeChartEvent)', { eventName });
|
logger.debug('chartUtils', '取消订阅图表事件 (unsubscribeChartEvent)', { eventName });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,10 +64,12 @@ export const createEventMarkerOverlay = (
|
|||||||
style: 'fill',
|
style: 'fill',
|
||||||
color: marker.color,
|
color: marker.color,
|
||||||
borderRadius: EVENT_MARKER_CONFIG.text.borderRadius,
|
borderRadius: EVENT_MARKER_CONFIG.text.borderRadius,
|
||||||
paddingLeft: EVENT_MARKER_CONFIG.text.padding,
|
padding: [
|
||||||
paddingRight: EVENT_MARKER_CONFIG.text.padding,
|
EVENT_MARKER_CONFIG.text.padding,
|
||||||
paddingTop: EVENT_MARKER_CONFIG.text.padding,
|
EVENT_MARKER_CONFIG.text.padding,
|
||||||
paddingBottom: EVENT_MARKER_CONFIG.text.padding,
|
EVENT_MARKER_CONFIG.text.padding,
|
||||||
|
EVENT_MARKER_CONFIG.text.padding,
|
||||||
|
] as any,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// 标记文本内容
|
// 标记文本内容
|
||||||
|
|||||||
Reference in New Issue
Block a user