How do you delete a graph? #125

Open
btipling opened this Issue Sep 15, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@btipling

I don't see anyway to use JavaScript to remove a graph and all the axis and what not. I just see ways to create graphs.

@vhmth

This comment has been minimized.

Show comment Hide comment
@vhmth

vhmth Sep 28, 2012

I created a clearGraph function that's laid out as follows:

function clearGraph() {
  $('#legend').empty();
  $('#chart_container').html(
    '<div id="chart"></div><div id="timeline"></div><div id="slider"></div>'
  );
}

That is, of course, if your legend is in a div with an id of 'legend' and your chart stuff is in a div with an id of 'chart_container' (like in the live data timeseries example on their site).

Hope that helped.

vhmth commented Sep 28, 2012

I created a clearGraph function that's laid out as follows:

function clearGraph() {
  $('#legend').empty();
  $('#chart_container').html(
    '<div id="chart"></div><div id="timeline"></div><div id="slider"></div>'
  );
}

That is, of course, if your legend is in a div with an id of 'legend' and your chart stuff is in a div with an id of 'chart_container' (like in the live data timeseries example on their site).

Hope that helped.

@vhmth

This comment has been minimized.

Show comment Hide comment
@vhmth

vhmth Sep 29, 2012

Also remember that this will clear the ENTIRE graph (including its template), not just the data.

vhmth commented Sep 29, 2012

Also remember that this will clear the ENTIRE graph (including its template), not just the data.

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