Skip to content
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

Cannot render chart from array #32

Closed
mharrisweb opened this issue Jan 25, 2016 · 1 comment
Closed

Cannot render chart from array #32

mharrisweb opened this issue Jan 25, 2016 · 1 comment

Comments

@mharrisweb
Copy link

Hello,

I am trying to pass data as an array, using the code below. The chart doesn;t appear just a grey box. I don't get any errors, Can you help?

         var chartAttributes = {
            chartType: this.props.chartTypes[this.state.statsChart.chartType],
            graph_id: this.props.chartTypes[this.state.statsChart.chartType],
            width: this.state.statsChart.chartWidth,
            height: this.state.statsChart.chartHeight,
            legend_toggle: true
        };

        chartAttributes.options = {
            title: 'Stats ' + this.props.chartTypes[this.state.statsChart.chartType],
            is3D: this.props.chartTypes[this.state.statsChart.chartType] == 'PieChart'
        };

        chartAttributes.data = [
            ['Attendance','Percentage'],
            ['Present',this.getCodesTotals().present[0]],
            ['Authorised Absent',this.getCodesTotals().authorisedAbsent[0]],
            ['Unauthorised Absent',this.getCodesTotals().unauthorisedAbsent[0]]
        ];

        return (
            <Chart {...chartAttributes} />
        );
@rakannimer
Copy link
Owner

Hey, sorry for the late reply.

This is either related to this #34
or the input that you're sending to it is wrong.

I'm closing this issue for now if the error occurs again I'd be happy to help you debug if you can post some code that I can run.

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants