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

tooltip and chart line/bar clicks not working #6

Closed mclarentgp closed 5 years ago

mclarentgp commented 7 years ago

I've created the following component, and when I import this component into another react component, it renders just fine, but the tooltips do not show and the event clicks on a bar or line do not work either. Is this a bug?

`import FusionCharts from 'fusioncharts'; import charts from 'fusioncharts/fusioncharts.charts'; import ReactFC from 'react-fusioncharts'; charts(FusionCharts);

export default class test extends React.Component { constructor(props) { super(props); }

render() {
    let myDataSource = {
        chart: {
            caption: "Harry's SuperMart",
            subCaption: "Top 5 stores in last month by revenue",
            numberPrefix: "$",
            theme: "ocean"
        },
        data: [{
            label: "Bakersfield Central",
            value: "880000"
        }, {
            label: "Garden Groove harbour",
            value: "730000"
        }, {
            label: "Los Angeles Topanga",
            value: "590000"
        }, {
            label: "Compton-Rancho Dom",
            value: "520000"
        }, {
            label: "Daly City Serramonte",
            value: "330000"
        }]
    };

let chartConfigs = {
    id: "revenue-chart2",
    renderAt: "revenue-chart-container2",
    type: "column2d",
    width: 500,
    height: 400,
    dataFormat: "json",
    dataSource: myDataSource,
    events: {
        dataplotclick: function (ev, props) {
            document.getElementById("value").innerHTML = props.displayValue;
        }
    }
};

    return (<ReactFC { ...chartConfigs } />);
}

}`

ayanbhaduryfc commented 6 years ago

Hi,

We checked the above sample at our end, in which tooltip is showing properly and the events are also getting fired properly. If you are still facing problem please share us a scale downsample so that we could investigate it further. For reference please check the sample from the given dropbox link based on your above code snippet - https://www.dropbox.com/s/yt6bq6lbutfksb3/tooltip-dataplotclick%20test.zip?dl=0

ashok1994 commented 5 years ago

@mclarentgp Closing this for now, reopen if the problem persists