update pay function
This commit is contained in:
@@ -129,14 +129,23 @@ const TradingViewChart: React.FC<TradingViewChartProps> = ({
|
||||
// 调试信息
|
||||
console.log('📈 Chart 对象:', chart);
|
||||
console.log('📈 Chart 类型:', typeof chart);
|
||||
console.log('📈 Chart 的方法:', Object.keys(chart));
|
||||
console.log('📈 Chart 的所有属性名:', Object.keys(chart));
|
||||
console.log('📈 Chart 的所有方法名:', Object.getOwnPropertyNames(Object.getPrototypeOf(chart)));
|
||||
console.log('📈 addLineSeries 存在?', typeof chart.addLineSeries);
|
||||
console.log('📈 addSeries 存在?', typeof chart.addSeries);
|
||||
console.log('📈 Chart 原型:', Object.getPrototypeOf(chart));
|
||||
|
||||
// 检查 chart 对象是否有效
|
||||
if (!chart || typeof chart.addLineSeries !== 'function') {
|
||||
console.error('❌ createChart 返回的对象无效!');
|
||||
console.error('Chart 对象:', chart);
|
||||
throw new Error('createChart 返回的对象没有 addLineSeries 方法');
|
||||
console.error('尝试查找所有包含 "series" 的方法:');
|
||||
const allProps = Object.getOwnPropertyNames(Object.getPrototypeOf(chart));
|
||||
const seriesMethods = allProps.filter(prop => prop.toLowerCase().includes('series'));
|
||||
console.error('包含 series 的方法:', seriesMethods);
|
||||
|
||||
// 不要立即抛出错误,先尝试使用可能的替代方法
|
||||
console.warn('⚠️ 尝试使用其他可能的方法名...');
|
||||
}
|
||||
|
||||
// 创建折线系列 (lightweight-charts 5.0 标准 API)
|
||||
|
||||
Reference in New Issue
Block a user