Skip to content

Commit

Permalink
Merge pull request #93 from ViderumGlobal/fix-filters-validation
Browse files Browse the repository at this point in the history
Fix chart title bug
  • Loading branch information
duskobogdanovski committed Jan 31, 2018
2 parents d48ac2e + e5cb061 commit ca23836
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ckanext/querytool/fanstatic/javascript/modules/viz-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,22 @@ ckan.module('querytool-viz-preview', function() {
};
var values;

var titleVal = this.options.title;
if(titleVal === true){
titleVal = '';
}

if (this.options.chart_type === 'donut' ||
this.options.chart_type === 'pie') {
values = records.map(function(item) {
return [item[x_axis], item[y_axis]]
});

options.data = {
columns: values,
type : this.options.chart_type
};
options.title = {
text: this.options.title
text: titleVal
}
} else {
values = records.map(function(item) {
Expand All @@ -119,7 +123,7 @@ ckan.module('querytool-viz-preview', function() {
}
};
options.title = {
text: this.options.title
text: titleVal
}
}

Expand Down

0 comments on commit ca23836

Please sign in to comment.