chilly

B.register is not a function.

Recommended Posts

Im getting an error of

TypeError: B.register is not a function
at /Test/node_modules/fusioncharts/fusioncharts.charts.js:6:125

I am using fusioncharts installed via npm and have reverted to your guide on rendering charts via npm. Following step by step the error comes when trying to include

require("fusioncharts/fusioncharts.charts")(FusionCharts);

Performing a search in the fusioncharts.charts.js file shows me there is a B.register function inside. Is the guide wrong and missing a step, or is this a bug. I can display the chart using HTML fine, the js implementation is having hiccups

Edited by chilly

Share this post


Link to post
Share on other sites

This error was without using a plugin, after trying the jquery plugin im receiving Function.register isnt a function. other libraries are rendering just fine, fusion however, refuses.

Edited by chilly

Share this post


Link to post
Share on other sites
On 11/11/2017 at 3:02 AM, chilly said:

Im getting an error of


TypeError: B.register is not a function
at /Test/node_modules/fusioncharts/fusioncharts.charts.js:6:125

I am using fusioncharts installed via npm and have reverted to your guide on rendering charts via npm. Following step by step the error comes when trying to include


require("fusioncharts/fusioncharts.charts")(FusionCharts);

Performing a search in the fusioncharts.charts.js file shows me there is a B.register function inside. Is the guide wrong and missing a step, or is this a bug. I can display the chart using HTML fine, the js implementation is having hiccups

Have you been able to fix this ? I am facing this issue as well.

Edited by Vishal Chhabria

Share this post


Link to post
Share on other sites

My problem was explained clear and concise to start with. Please re-read it so I can assist you further. 

Side Note: I will instead move away from fusion. Nice charts, terrible support. Problem was explained clearly, I stated exactly where the error was occurring, and the exact steps I followed from FusionCharts own tutorial on rendering charts using npm, including a link to the steps. Im not building a sample project for you to have a week long confused conversation about why your product isnt functioning as intended and hear you say its working on your end. Every other library is functioning properly. Have a good day.

Share this post


Link to post
Share on other sites

Hey @chilly,

Apologies for inconvenience. Since, files installed from NPM are minified version of FusionCharts and it will be very difficult for us to debug the issue that you are facing.

It will be great if you could provide us with exact steps or scaled down sample so that we can replicate the issue and debug it further using source map.

Share this post


Link to post
Share on other sites

Maybe my english isn't very good? My OP stated the exact steps and included a link. My Second reply added clarification as requested. My third reply stated clearly that I have explained best I could. Lets try more ways. I can also provide pictures or cartoon drawings if needed. (Marker or Crayon, your choice ^_^)

Steps copied and pasted from the link above incase your mouse is broken:

Installing the fusioncharts Package

Step 1: Install the FusionCharts package.

npm install fusioncharts

Step 2: Load FusionCharts using require.

var FusionCharts = require("fusioncharts");

Step 3: Load the charts module using require.

require("fusioncharts/fusioncharts.charts")(FusionCharts);

Step 4: Create the FusionCharts instance required to render the chart.

var chart = new FusionCharts ({
	   "type": "column2d",
	   "width": "500",
	   "height": "300",
	   "dataFormat": "json",
	   "dataSource": {
		    chart:{},
		    data: [{value: 500}, {value: 600}, {value: 700}]
	 	}
	}).render("chartContainer");

Share this post


Link to post
Share on other sites

Hey @chilly

FusionCharts is not completely ES6 compatible as of now so you have to use webpack bundler to render the charts. We have created a sample for you reference. Please follow the below steps to run the same:
- Extract zip file and navigate to fc-demo folder via terminal/command line.
- use below command to install all the dependencies.

npm install

- use command to bundle the package (webpack is used for bundling - you can check bundle config in package.json)

npm run bundle

- Run index.html file.

We have reported this issue internally and team is working on ES6 compatibility.

fc-demo.zip

Share this post


Link to post
Share on other sites
On 11/24/2017 at 8:32 PM, Gagan Sikri said:

Hey @chilly

FusionCharts is not completely ES6 compatible as of now so you have to use webpack bundler to render the charts. We have created a sample for you reference. Please follow the below steps to run the same:
- Extract zip file and navigate to fc-demo folder via terminal/command line.
- use below command to install all the dependencies.


npm install

- use command to bundle the package (webpack is used for bundling - you can check bundle config in package.json)


npm run bundle

- Run index.html file.

We have reported this issue internally and team is working on ES6 compatibility.

fc-demo.zip

Till when should we expect FusionCharts to be compatible with ES6 ?

Edited by Vishal Chhabria

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now