File tree Expand file tree Collapse file tree
playground/src/examples/render Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,12 +49,9 @@ const RenderCustom: React.FC = () => {
4949 const cleaned = cleanAndFormatJSON ( data ) ;
5050 // 将 JSON 字符串解析为对象
5151 const parsedData = JSON . parse ( cleaned ) ;
52- advisor . render ( {
53- container : '#img-chart' ,
54- spec : parsedData ,
55- } as any ) ;
52+ advisor . render ( '#img-chart' , parsedData ) ;
5653 } catch ( error ) {
57- message . error ( ' 请输入有效的 JSON 格式数据' ) ;
54+ message . error ( ` 请输入有效的 JSON 格式数据: ${ error } ` ) ;
5855 }
5956 } ;
6057
Original file line number Diff line number Diff line change @@ -42,12 +42,9 @@ const RenderDefault: React.FC = () => {
4242 const cleaned = cleanAndFormatJSON ( data ) ;
4343 // 将 JSON 字符串解析为对象
4444 const parsedData = JSON . parse ( cleaned ) ;
45- advisor . render ( {
46- container : '#chart' ,
47- spec : parsedData ,
48- } as any ) ;
45+ advisor . render ( '#chart' , parsedData ) ;
4946 } catch ( error ) {
50- message . error ( ' 请输入有效的 JSON 格式数据' ) ;
47+ message . error ( ` 请输入有效的 JSON 格式数据: ${ error } ` ) ;
5148 }
5249 } ;
5350
Original file line number Diff line number Diff line change @@ -67,12 +67,9 @@ const RenderDemand: React.FC = () => {
6767 const cleaned = cleanAndFormatJSON ( data ) ;
6868 // 将 JSON 字符串解析为对象
6969 const parsedData = JSON . parse ( cleaned ) ;
70- advisor . render ( {
71- container : '#img-chart' ,
72- spec : parsedData ,
73- } as any ) ;
70+ advisor . render ( '#img-chart' , parsedData ) ;
7471 } catch ( error ) {
75- message . error ( `请输入有效的 JSON 格式数据: ${ ( error as Error ) . message } ` ) ;
72+ message . error ( `请输入有效的 JSON 格式数据: ${ error } ` ) ;
7673 }
7774 } ;
7875
You can’t perform that action at this time.
0 commit comments