Skip to content

Commit

Permalink
hide legends. #205
Browse files Browse the repository at this point in the history
  • Loading branch information
jwildfire committed Nov 2, 2017
1 parent 55af0c1 commit c4fed69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build/webcodebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3039,6 +3039,15 @@
'.web-codebook .chartMaker.section .cm-chart',
chartMaker.chartSettings
);

//remove legend unless it's a bar chart
chartMaker.chart.on('resize', function() {
console.log(this);
if (this.config.legend.label == 'highlight') {
this.legend.remove();
}
});

if (codebook.config.group) {
chartMaker.chart.on('draw', function() {
var level = this.wrap.select('.wc-chart-title').text();
Expand Down Expand Up @@ -4257,8 +4266,6 @@
.classed('listing-container', true);

//drop ignoredColumns and system variables
console.log(explorer);

explorer.config.tableConfig.cols = Object.keys(explorer.config.files[0])
.filter(function(f) {
return explorer.config.ignoredColumns.indexOf(f) == -1;
Expand Down
9 changes: 9 additions & 0 deletions src/codebook/chartMaker/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ export function draw(codebook) {
'.web-codebook .chartMaker.section .cm-chart',
chartMaker.chartSettings
);

//remove legend unless it's a bar chart
chartMaker.chart.on('resize', function() {
console.log(this);
if (this.config.legend.label == 'highlight') {
this.legend.remove();
}
});

if (codebook.config.group) {
chartMaker.chart.on('draw', function() {
var level = this.wrap.select('.wc-chart-title').text();
Expand Down

0 comments on commit c4fed69

Please sign in to comment.