FusionCharts Sankey Diagram in React Native Expo

52 Views Asked by At

enter image description here

Anyone know how to render fusionChart sankey diagram in React Native Expo app.

I implemented this but it renders text showing " loading chart please wait "

Here is my code:

import React from 'react';
import FusionCharts from 'react-native-fusioncharts';

const SankeyChart = () => {

  const sankeyChartData = {
    nodes: [
      {label: 'Node A'},
      {label: 'Node B'},
      {label: 'Node C'},  
    ],
    links: [
      {source: 'Node A', target: 'Node B', value: 20},
      {source: 'Node B', target: 'Node C', value: 15},
    ],
  };


  const chartConfig = {
    type: 'sankey',
    width: 300,
    height: 300,
    dataFormat: 'json',
    dataSource: {
      chart: {
        caption: 'Sankey Diagram',
        theme: 'fusion',
      },
      link: sankeyChartData.links,
      node: sankeyChartData.nodes,
    },
  };

  return <FusionCharts chartConfig={chartConfig} />;
};

export default SankeyChart;

0

There are 0 best solutions below