Skip to content

Commit 32035f9

Browse files
committed
register assam map for charts
1 parent 28a6455 commit 32035f9

File tree

2 files changed

+185
-203
lines changed

2 files changed

+185
-203
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/[id]/edit/charts/components/ChartsVisualize.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React, { useCallback, useEffect, useRef, useState } from 'react';
2+
3+
import * as echarts from 'echarts/core';
24
import { useParams } from 'next/navigation';
35
import { graphql } from '@/gql';
46
import {
@@ -23,7 +25,7 @@ import {
2325

2426
import { GraphQL } from '@/lib/api';
2527
import { Icons } from '@/components/icons';
26-
import { vizdata } from './data';
28+
import assam_geojson from './data';
2729

2830
interface 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

Comments
 (0)