question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Clear Error for BarChart

See original GitHub issue

I am getting a recurring type error in bundle.js file.

"Cannot read property 'map' of undefined" in bundle.js for BarChart An object is undefined and trying to map to an array, but I am not sure where this is coming from because the failure is in a minified script (in bundle.js). As you can see this is the example code straight from github. Am I doing something wrong, or is this an issue?

var React =  require('react');
var ReactDOM = require('react-dom');
var Display = require('./parts/display');
var d3 = require('d3');
var BarChart = require('react-d3-components').BarChart;
var scope;
class board extends React.Component
{
    constructor()
    {
        super()

        scope=this;


    }
    render()
    {

            var data = [{
        label: 'Answer',
        values: [{x: 'SomethingA', y: 10}, {x: 'SomethingB', y: 4}, {x: 'SomethingC', y: 3}]
    }];
        debugger;
        console.log(JSON.stringify(this.props.results));
        return(
                <div id='scoreboard'>

                    <Display if={this.props.status === 'connected' && this.props.currentQuestion.q}>
                    // <BarChart data={this.props.results} title={this.props.currentQuestion.q} height={window.innerHeight * 0.6} width={window.innerWidth * 0.9}/>
                     <BarChart
                             data={data}
                             width={400}
                            height={400}
                            title="Answer Results"
                            xScale={1}
                            yScale={1}
                            margin={{top: 10, bottom: 50, left: 50, right: 10}} />
                    </Display>

                    <Display if={this.props.status === 'connected' && !this.props.currentQuestion.q}>
                    <h3>Awaiting a Question...</h3>
                    </Display>


                </div>
            );
    }
}

module.exports = board;






Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
codesukicommented, Oct 23, 2016

@solomein thank you! Your help is appreciated 😃 Are you still working on the fixes you told me? I will merge any pullreqs 😃

@WiseNN I am glad the problem is fixed! Good luck 😃

1reaction
solomeincommented, Oct 22, 2016

@WiseNN You are using the wrong comment style at this place

<BarChart data={this.props.results} title={this.props.currentQuestion.q} height={window.innerHeight * 0.6} width={window.innerWidth * 0.9}/>

// doesn’t work, you should use {/* code */}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add, change, or remove error bars in a chart - Microsoft Support
Add or remove error bars · Click anywhere in the chart. · Click the Chart Elements button Chart Elements button · To change...
Read more >
Error for bar chart in matplotlib python 3 - Stack Overflow
I am trying to make a bar graph (from mean values) that includes error bars (from standard deviation values) ...
Read more >
How to add error bars in Excel: standard and custom - Ablebits
To remove all error bars from your graph, click anywhere within the chart, then click the Chart Elements button and clear the Error...
Read more >
The issue with error bars - From data to Viz
The second issue with error bars is that they are used to show different metrics , and it is not always clear which...
Read more >
OK button greyed out when creating a stacked bar chart - IBM
There are two ways to work around this situation: 1. Select the 'Reset' button in the Chart Builder window and rebuild your chart...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found