when i run the server..this component is loaded ...no errors found on server side...but browser console gives back a following error :
Uncaught TypeError: (intermediate value)[chartType] is not a function
my code is as follows :
var React = require('react');
var ReactDOM = require('react-dom');
var chart = require('chart.js');
var DoughnutChart = require("react-chartjs").Doughnut;
var Tempvshum = React.createClass({
render() {
var chartOptions = {
segmentShowStroke : true
};
var chartData = [{
value: 300,
color:"#F7464A",
highlight: "#FF5A5E",
label: "Red"
}];
return(<DoughnutChart data={chartData} options={chartOptions} />);
}
});
module.exports = Tempvshum;
var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {});Seems that this is the line that is causing the problem from react-chart