Merge "Clear barchart before rendering it"
This commit is contained in:
commit
9ab450c93d
@ -240,6 +240,8 @@ horizon.d3_bar_chart = {
|
||||
*/
|
||||
self.refresh = function(){
|
||||
var self = this;
|
||||
// Clear the chart before rendering it
|
||||
self.jquery_element.empty();
|
||||
self.render();
|
||||
};
|
||||
|
||||
|
@ -374,8 +374,8 @@ horizon.d3_line_chart = {
|
||||
url: self.final_url,
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
// Clearing the old chart data.
|
||||
$(self.html_element).html('');
|
||||
$(self.legend_element).html('');
|
||||
self.jquery_element.empty();
|
||||
$(self.legend_element).empty();
|
||||
|
||||
self.series = data.series;
|
||||
self.stats = data.stats;
|
||||
@ -384,7 +384,7 @@ horizon.d3_line_chart = {
|
||||
|
||||
if (self.series.length <= 0) {
|
||||
$(self.html_element).html(gettext('No data available.'));
|
||||
$(self.legend_element).html('');
|
||||
$(self.legend_element).empty();
|
||||
// Setting a fix height breaks things when legend is getting
|
||||
// bigger.
|
||||
$(self.legend_element).css('height', '');
|
||||
@ -394,7 +394,7 @@ horizon.d3_line_chart = {
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$(self.html_element).html(gettext('No data available.'));
|
||||
$(self.legend_element).html('');
|
||||
$(self.legend_element).empty();
|
||||
// Setting a fix height breaks things when legend is getting
|
||||
// bigger.
|
||||
$(self.legend_element).css('height', '');
|
||||
@ -548,7 +548,7 @@ horizon.d3_line_chart = {
|
||||
$(self.html_element).append(self.backdrop);
|
||||
|
||||
// Hide the legend.
|
||||
$(self.legend_element).html('').addClass('disabled');
|
||||
$(self.legend_element).empty().addClass('disabled');
|
||||
|
||||
// Show the spinner.
|
||||
self.spinner = $('<div class="spinner_wrapper"></div>');
|
||||
|
Loading…
Reference in New Issue
Block a user