Skip to content

Commit a633ea1

Browse files
committed
Boxplot supports multiple visualizations. Fixed style
1 parent cc4dc74 commit a633ea1

File tree

2 files changed

+204048
-204047
lines changed

2 files changed

+204048
-204047
lines changed

appserver/static/visualizations/boxplot/src/visualization_source.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ function(
2020
// Save this.$el for convenience
2121
this.$el = $(this.el);
2222

23+
// Handle multiple Graphs
24+
this.__uniqueID = Math.floor(Math.random() * 100000);
25+
2326
// Add a css selector class
24-
this.$el.attr('id', 'boxplotContainer');
27+
this.$el.attr('id', 'boxplotContainer_' + this.__uniqueID);
2528
},
2629

2730
getInitialDataParams: function() {
@@ -105,7 +108,7 @@ function(
105108
var plotPoints = this._getBoxOutliers(this._getEscapedProperty('boxPoints', config) || "none");
106109

107110
// Cleanup previous data
108-
Plotly.purge('boxplotContainer');
111+
Plotly.purge('boxplotContainer_' + this.__uniqueID);
109112
$('#' + this.id).empty();
110113

111114
// create a trace for every group of data
@@ -124,10 +127,7 @@ function(
124127
var layout = {
125128
autosize: true,
126129
margin: {
127-
r: 10,
128-
t: 10,
129-
b: 40,
130-
l: 60
130+
t: 50
131131
},
132132
showlegend: dispLegend,
133133
xaxis: {
@@ -140,13 +140,13 @@ function(
140140
autorange: true,
141141
tickangle: yTickAngle,
142142
title: yAxisLabel
143-
},
144-
boxmode: 'group'
143+
}
145144
};
146145

147146
// Plotting the chart
148-
Plotly.plot('boxplotContainer', dataInput, layout, {
149-
displayModeBar: modeBar
147+
Plotly.plot('boxplotContainer_' + this.__uniqueID, dataInput, layout, {
148+
displayModeBar: modeBar,
149+
displaylogo: false
150150
});
151151

152152
},

0 commit comments

Comments
 (0)