Merge pull request #1437 from daschw/plotly-bar

RFC: use bar recipe in plotly
This commit is contained in:
Daniel Schwabeneder 2018-03-20 17:11:37 +01:00 committed by GitHub
commit 004ad15875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ const _plotly_attr = merge_with_base_supported([
]) ])
const _plotly_seriestype = [ const _plotly_seriestype = [
:path, :scatter, :bar, :pie, :heatmap, :path, :scatter, :pie, :heatmap,
:contour, :surface, :wireframe, :path3d, :scatter3d, :shape, :scattergl, :contour, :surface, :wireframe, :path3d, :scatter3d, :shape, :scattergl,
] ]
const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot] const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot]
@ -556,17 +556,6 @@ function plotly_series(plt::Plot, series::Series)
end end
d_out[:x], d_out[:y] = x, y d_out[:x], d_out[:y] = x, y
elseif st == :bar
d_out[:type] = "bar"
d_out[:x], d_out[:y], d_out[:orientation] = if isvertical(series)
x, y, "v"
else
y, x, "h"
end
d_out[:width] = series[:bar_width]
d_out[:marker] = KW(:color => _cycle(rgba_string.(series[:fillcolor]),eachindex(series[:x])),
:line => KW(:width => series[:linewidth]))
elseif st == :heatmap elseif st == :heatmap
d_out[:type] = "heatmap" d_out[:type] = "heatmap"
d_out[:x], d_out[:y], d_out[:z] = x, y, z d_out[:x], d_out[:y], d_out[:z] = x, y, z