Elmaro

Uncaught TypeError: Cannot read property 'xConfigs'/'dataset' of undefined

Recommended Posts

I have created a timeseries class component with the following state:

this.state = {
			timeseriesDs: {
				type: "timeseries",
				id: "myChart",
				renderAt: "container",
				series: "Type",
				width: "100%",
				height: "95%",
				dataSource: {
					chart: { multicanvas: props.multiGrid, exportEnabled: true },
					caption: {
						text: props.caption,
					},
					subCaption: {
						text: props.subCaption,
					},
					yaxis: this.generateYaxis(),
				},
			},
			tagList: props.tagList,
			schema: this.generateSchema(),
		};

The following function is used to change the timeseries' multicanvas property:

changeType() {
	let timeseriesCopy = this.state.timeseriesDs;
	timeseriesCopy.dataSource.chart = { multicanvas: this.props.multiGrid, exportEnabled: true };
	this.setState({ timeseriesDs: timeseriesCopy });
}

When I use this function, everything works fine, and the chart changes from having plots for each line to only having one plot with multiple lines. This also works when changing back and forth. However, after changing using the function twice, I get these errors:

image.png.b32ca5653f684e4c695569756aede11e.png

Everything seemingly still works fine after these errors, but they show up again every time the changeType-function is used. How do I get rid of these pesky errors?

("react-fusioncharts": "^3.1.2", "fusioncharts": "^3.16.0")

Edited by Elmaro

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