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

bar graph not rendering #1970

Open
gib65 opened this issue Feb 22, 2017 · 1 comment
Open

bar graph not rendering #1970

gib65 opened this issue Feb 22, 2017 · 1 comment

Comments

@gib65
Copy link

gib65 commented Feb 22, 2017

Hello,

I have a bar chart that I'm trying to populate with data, but it doesn't seem to be working. It doesn't render any bars.

Here's the Javascript I'm running:

var inherentCauseCriticalityByReceptorConfig = {
    bindto: 'InherentCauseCriticalityByReceptor',
    showLabels: true,
    showLegend: true,
    showYAxis: true,
    showTooltip: true
};

...

inherentCauseCriticalityByReceptorBarGraph = ra.charting.barChart(inherentCauseCriticalityByReceptorConfig);

...

inherentCauseCriticalityByReceptorBarGraph.startLoading();

...

    var DMCats = ['EquipmentFailure', 'Undetermined'];
    var tempColors = {
        EquipmentFailure: '#FF0000',
        Undetermined: '#0000FF'
    };
    var tempData = [{ EquipmentFailure: 10000, label: '1 - Equipment Failure' }, { Undetermined: 1000, label: '2 - Undetermined' }];

        inherentCauseCriticalityByReceptorBarGraph.loadData({
            data: tempData,
            stacked: true,
            xValue: 'label',
            yValue: DMCats,
            colors: tempColors
        });

...

inherentCauseCriticalityByReceptorBarGraph.doneLoading();

I'm expecting to see at least two bars in the graph: 1 - Equipment Failure, which is red and reads 10000, and 2 - Undetermined, which is blue and reads 1000, but nothing's showing up in the graph.

I've copied this code from another page in our application which does work.

Can anyone see any reason the bar graph doesn't render?

Thanks.

@panthony
Copy link
Contributor

Hi,

Could you provide a JSFiddle or Plunkr highlighting the issue?

It makes reproduction much easier for everyone.

Thank you!

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

No branches or pull requests

2 participants