mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 17:38:54 +00:00
getredash/redash#2107 Fix: chart x-axis height setting
This commit is contained in:
parent
9d7f079d94
commit
96a73b0c9e
@ -13,6 +13,8 @@ Plotly.setPlotConfig({
|
||||
modeBarButtonsToRemove: ['sendDataToCloud'],
|
||||
});
|
||||
|
||||
const DEFAULT_BOTTOM_MARGIN = 50;
|
||||
|
||||
// The following colors will be used if you pick "Automatic" color.
|
||||
const BaseColors = {
|
||||
Blue: '#4572A7',
|
||||
@ -225,6 +227,8 @@ const PlotlyChart = () => ({
|
||||
|
||||
|
||||
function recalculateOptions() {
|
||||
scope.layout.margin.b = parseInt(scope.options.bottomMargin, 10) || DEFAULT_BOTTOM_MARGIN;
|
||||
|
||||
scope.data.length = 0;
|
||||
scope.layout.showlegend = has(scope.options, 'legend') ? scope.options.legend.enabled : true;
|
||||
delete scope.layout.barmode;
|
||||
@ -443,7 +447,7 @@ const PlotlyChart = () => ({
|
||||
|
||||
scope.layout = {
|
||||
margin: {
|
||||
l: 50, r: 50, b: 50, t: 20, pad: 4,
|
||||
l: 50, r: 50, b: DEFAULT_BOTTOM_MARGIN, t: 20, pad: 4,
|
||||
},
|
||||
width: container.offsetWidth,
|
||||
height: container.offsetHeight,
|
||||
|
Loading…
Reference in New Issue
Block a user