Skip to content

Commit cc177a4

Browse files
Merge pull request #516 from plotly/fix-duration-bar-plot
Fix bar plot issues with Duration
2 parents 25992a0 + 3c413c4 commit cc177a4

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

plotly/plotlyfig_aux/handlegraphics/updateBar.m

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
% outliercolor: ...[NA]
4242
% outlierwidth: ...[NA]
4343

44-
%---------------------------------------------------------------------%
45-
4644
%-AXIS INDEX-%
4745
axIndex = obj.getAxisIndex(obj.State.Plot(barIndex).AssociatedAxis);
4846

@@ -52,29 +50,21 @@
5250
%-CHECK FOR MULTIPLE AXES-%
5351
[xSource, ySource] = findSourceAxis(obj, axIndex);
5452

55-
%---------------------------------------------------------------------%
56-
5753
%-associate axis-%
5854
obj.data{barIndex}.xaxis = "x" + xSource;
5955
obj.data{barIndex}.yaxis = "y" + ySource;
60-
61-
%---------------------------------------------------------------------%
62-
63-
%-set trace-%
6456
obj.data{barIndex}.type = "bar";
6557
obj.data{barIndex}.name = barData.DisplayName;
6658
obj.data{barIndex}.visible = strcmp(barData.Visible,"on");
6759

68-
%---------------------------------------------------------------------%
69-
7060
%-set plot data-%
7161
xData = barData.XData;
7262
yData = barData.YData;
7363

74-
if isduration(xData) || isdatetime(xData)
64+
if isdatetime(xData)
7565
xData = datenum(xData);
7666
end
77-
if isduration(yData) || isdatetime(yData)
67+
if isdatetime(yData)
7868
yData = datenum(yData);
7969
end
8070

@@ -89,16 +79,12 @@
8979
obj.data{barIndex}.y = xData;
9080
end
9181

92-
%---------------------------------------------------------------------%
93-
9482
%-trace settings-%
9583
markerline = extractAreaLine(barData);
9684

9785
obj.data{barIndex}.marker = extractAreaFace(barData);
9886
obj.data{barIndex}.marker.line = markerline;
9987

100-
%---------------------------------------------------------------------%
101-
10288
%-layout settings-%
10389
obj.layout.bargroupgap = 1-barData.BarWidth;
10490

@@ -118,8 +104,6 @@
118104
obj.layout.barmode = "relative";
119105
end
120106

121-
%---------------------------------------------------------------------%
122-
123107
%-bar showlegend-%
124108
leg = barData.Annotation;
125109
legInfo = leg.LegendInformation;

0 commit comments

Comments
 (0)