11import React , { useCallback , useEffect , useRef , useState } from 'react' ;
2+
3+ import * as echarts from 'echarts/core' ;
24import { useParams } from 'next/navigation' ;
35import { graphql } from '@/gql' ;
46import {
@@ -23,7 +25,7 @@ import {
2325
2426import { GraphQL } from '@/lib/api' ;
2527import { Icons } from '@/components/icons' ;
26- import { vizdata } from './data' ;
28+ import assam_geojson from './data' ;
2729
2830interface VisualizationProps {
2931 setType : any ;
@@ -220,6 +222,7 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
220222 } , [ chartId , chartDetails ] ) ;
221223
222224 const updateChartData = ( resourceChart : any ) => {
225+ echarts . registerMap ( "assam_district" , assam_geojson )
223226 const updatedData = {
224227 aggregateType : resourceChart . aggregateType as AggregateType ,
225228 chartType : resourceChart . chartType as ChartTypes ,
@@ -534,7 +537,7 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
534537 </ div >
535538 < div className = "mb-6 flex flex-col gap-6 p-8 text-center" >
536539 < Text > Preview</ Text >
537- { Object . keys ( chartData . chart ) . length > 0 && (
540+ { Object ? .keys ( chartData . chart ) . length > 0 && (
538541 < ReactECharts option = { chartData . chart } ref = { chartRef } />
539542 ) }
540543 </ div >
0 commit comments