@@ -226,28 +226,28 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
226226 chartId : resourceChart . id ,
227227 description : resourceChart . description || '' ,
228228 filters :
229- resourceChart . filters ?. length > 0
230- ? resourceChart . filters . map ( ( filter : any ) => ( {
229+ resourceChart . chartFilters ?. length > 0
230+ ? resourceChart . chartFilters . map ( ( filter : any ) => ( {
231231 column : filter . column ?. id ,
232232 operator : filter . operator ,
233233 value : filter . value ,
234234 } ) )
235235 : [ { column : '' , operator : '==' , value : '' } ] ,
236236 name : resourceChart . name || '' ,
237237 options : {
238- aggregateType : resourceChart ?. options ?. aggregateType ,
239- regionColumn : resourceChart ?. options ?. regionColumn ?. id ,
240- showLegend : resourceChart ?. options ?. showLegend ?? true ,
241- timeColumn : resourceChart ?. options ?. timeColumn ,
242- valueColumn : resourceChart ?. options ?. valueColumn ?. id ,
243- xAxisColumn : resourceChart ?. options ?. xAxisColumn ?. id ,
244- xAxisLabel : resourceChart ?. options ?. xAxisLabel ,
245- yAxisColumn : resourceChart ?. options ?. yAxisColumn ?. map ( ( col : any ) => ( {
238+ aggregateType : resourceChart ?. chartOptions ?. aggregateType ,
239+ regionColumn : resourceChart ?. chartOptions ?. regionColumn ?. id ,
240+ showLegend : resourceChart ?. chartOptions ?. showLegend ?? true ,
241+ timeColumn : resourceChart ?. chartOptions ?. timeColumn ,
242+ valueColumn : resourceChart ?. chartOptions ?. valueColumn ?. id ,
243+ xAxisColumn : resourceChart ?. chartOptions ?. xAxisColumn ?. id ,
244+ xAxisLabel : resourceChart ?. chartOptions ?. xAxisLabel ,
245+ yAxisColumn : resourceChart ?. chartOptions ?. yAxisColumn ?. map ( ( col : any ) => ( {
246246 fieldName : col . field . id ,
247247 label : col . label ,
248248 color : col . color ,
249249 } ) ) ,
250- yAxisLabel : resourceChart ?. options ?. yAxisLabel ,
250+ yAxisLabel : resourceChart ?. chartOptions ?. yAxisLabel ,
251251 } ,
252252 resource : resourceChart . resource ?. id ,
253253 type : resourceChart . chartType as ChartTypes ,
@@ -445,8 +445,8 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
445445 />
446446 < div className = "mb-6 flex flex-col gap-6 p-8 text-center" >
447447 < Text > Preview</ Text >
448- { chartData . chart . options && Object . keys ( chartData . chart . options ) . length > 0 && (
449- < ReactECharts option = { chartData . chart . options } ref = { chartRef } />
448+ { chartData . chart ? .options && Object . keys ( chartData . chart ? .options ) . length > 0 && (
449+ < ReactECharts option = { chartData . chart ? .options } ref = { chartRef } />
450450 ) }
451451 </ div >
452452 </ div >
0 commit comments