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

Resizing a graph in a array/dictionary of graphs #75

Closed
mzupan opened this issue Jun 14, 2012 · 1 comment
Closed

Resizing a graph in a array/dictionary of graphs #75

mzupan opened this issue Jun 14, 2012 · 1 comment

Comments

@mzupan
Copy link

mzupan commented Jun 14, 2012

This errors out in latest also when you try to resize


<!doctype>

<script src="../vendor/d3.min.js"></script>
<script src="../vendor/d3.layout.min.js"></script>

<script src="../rickshaw.js"></script>


<div id="chart"></div>

<button id="change" onclick="change()">Push Me</button>

<div id="chart2"></div>

<script>

graphs = {};

graphs['g1'] = new Rickshaw.Graph( {
    element: document.querySelector("#chart"),
    width: 300,
    height: 200,
    interpolation: 'step-after',
    series: [
        {
            data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
            color: 'steelblue'
        }
    ]
} );
graphs['g1'].render();


graphs['g2'] = new Rickshaw.Graph( {
    element: document.querySelector("#chart2"),
    width: 300,
    height: 200,
    interpolation: 'step-after',
    series: [
        {
            data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
            color: 'steelblue'
        }
    ]
} );
graphs['g2'].render();

function change() {
    graphs['g1'].configure({ width: 600, height: 400 }); 
    graphs['g1'].render();
};

</script>

Errors with

Uncaught ReferenceError: graph is not defined rickshaw.js:566

@mzupan
Copy link
Author

mzupan commented Jun 14, 2012

strange.. thought I had the latest pulled but it seemed it was fixed. Guess I was using an updated release.

@mzupan mzupan closed this as completed Jun 14, 2012
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

1 participant