Merge pull request #3443 from yha/plotly-shapes-fix
Fix shapes series on plotly
This commit is contained in:
commit
c986bfa1e6
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user