Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Resizing a graph loses the interpolation #74

Closed
mzupan opened this Issue Jun 14, 2012 · 3 comments

Comments

Projects
None yet
3 participants

mzupan commented Jun 14, 2012

Here is a sample.. If you set the interpolation on a new render() after a configure it will lose it and go back to the default which seems to be cardinal

<!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>

<script>

var graph = 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'
        }
    ]
} );
graph.render();

function change() {
    graph.configure({ width: 600, height: 400 }); 
    graph.render();
};

</script>

mzupan commented Jun 14, 2012

Here is a quick "fix"

configure({ width: 600, height: 400, interpolation: 'step-after' });

Doesn't seem to me that configure should go back to defaults though

Contributor

dchester commented Jun 15, 2012

Agreed -- that seems like a real bug. We'll take a look.

@dchester dchester closed this in f526279 Jun 17, 2012

This is still happening

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