Fix shapes series on plotly

This commit is contained in:
yha 2021-04-18 13:41:10 +03:00
parent 0a7035979f
commit e449d3221c

View File

@ -662,7 +662,7 @@ function plotly_series(plt::Plot, series::Series)
end
function plotly_series_shapes(plt::Plot, series::Series, clims)
segments = collect(series_segments(series))
segments = series_segments(series)
plotattributes_outs = Vector{KW}(undef, length(segments))
# TODO: create a plotattributes_out for each polygon
@ -681,7 +681,7 @@ function plotly_series_shapes(plt::Plot, series::Series, clims)
for (letter, data) in zip((:x, :y), shape_data(series, 100))
)
for segment in segments
for (k, segment) in enumerate(segments)
i, rng = segment.attr_index, segment.range
length(rng) < 2 && continue
@ -701,10 +701,10 @@ function plotly_series_shapes(plt::Plot, series::Series, clims)
:dash => string(get_linestyle(series, i)),
)
end
plotattributes_out[:showlegend] = i==1 ? should_add_to_legend(series) : false
plotattributes_out[:showlegend] = k==1 ? should_add_to_legend(series) : false
plotly_polar!(plotattributes_out, series)
plotly_hover!(plotattributes_out, _cycle(series[:hover], i))
plotattributes_outs[i] = plotattributes_out
plotattributes_outs[k] = plotattributes_out
end
if series[:fill_z] !== nothing
push!(plotattributes_outs, plotly_colorbar_hack(series, plotattributes_base, :fill))