fusioncharts / react-fusioncharts-component

ReactJS component for FusionCharts JavaScript Charting library.
https://fusioncharts.github.io/react-fusioncharts-component/
MIT License
93 stars 33 forks source link

Are powercharts supported? Issue with dragnode #61

Closed watery closed 3 years ago

watery commented 3 years ago

Hi, I'm giving a quick try at adding a graph to an existing React application which already successfully shows bar charts and angular charts (gauges).

I keep getting

Uncaught SyntaxError: expected expression, got '<'

and

The script from “http://localhost:3000/fleet-management/machine/fusioncharts.powercharts.js” has been loaded although its MIME type (“text/html”) isn't a valid JavaScript MIME type

in the browser console.

I copied the example code from here https://www.fusioncharts.com/charts/drag-node-charts/simple-graph-layout?framework=react and added to the webapp source. I didn't change any dependency. Am I missing something perhaps?

watery commented 3 years ago

Nevermind, I was missing these lines:

import Powercharts from 'fusioncharts/fusioncharts.powercharts';
Powercharts(FusionCharts);

Now the graph shows up correctly.