Skip to content

Commit 265a672

Browse files
author
Andrey1024
committed
add attribute 'display-legend' for area plot
1 parent 4ad76ba commit 265a672

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/idd/idd.area.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ InteractiveDataDisplay.Area = function (div, master) {
77
// Initialization (#1)
88
var initializer = InteractiveDataDisplay.Utils.getDataSourceFunction(div, InteractiveDataDisplay.readCsv);
99
var initialData = initializer(div);
10+
var displayInLegend = $(div).attr("data-idd-legend-visible") == "false" ? false : true;
11+
1012

1113
this.base = InteractiveDataDisplay.CanvasPlot;
1214
this.base(div, master);
@@ -143,6 +145,8 @@ InteractiveDataDisplay.Area = function (div, master) {
143145
};
144146

145147
this.getLegend = function () {
148+
if (!displayInLegend)
149+
return undefined;
146150
var that = this;
147151
var canvas = $("<canvas></canvas>");
148152
canvas[0].width = 40;

0 commit comments

Comments
 (0)