-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make it work on ReactJS ? #16
Comments
Figure it out? |
unfortunatelly, no. the team decided to use amcharts instead |
Any update on this please? |
I've made the example from here work by just importing the charts.funnel.js import React, { Component } from "react";
import Chart from 'chart.js';
import * as funnel from 'chartjs-funnel'
export default class FunnelChart extends Component{
chartRef = React.createRef();
componentDidMount() {
const myChartRef = this.chartRef.current.getContext("2d");
new Chart(myChartRef, {
type: 'funnel',
data: {
datasets: [{
data: [30, 60, 90],
backgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB",
"#FFCE56"
]
}],
labels: [
"Red",
"Blue",
"Yellow"
]
},
options: {
//Customize chart options
}
});
}
render() {
return (
<canvas
id="myChart"
ref={this.chartRef}
/>
)
}
} |
Instead of importing from chart.js use chartjs-funnel/dist/chart.funnel.bundled`import React from 'react'; var config = { class FunnelChart extends React.Component {
} |
Hey guys
I'm trying to use ChartFunnel on a project using ReactJS. I've tried using some things that i saw in this issue but unfortunatelly didn't have much success.
The console doesn't show any errors, but the chart doesn't render.
Does anyone achieved something with React and ChartFunnel ?
Thanks for the help :)
The text was updated successfully, but these errors were encountered: