# Slider Plot with legend. Can I hard-code a legend without adding extra traces?

**URL:** <https://community.plotly.com/t/slider-plot-with-legend-can-i-hard-code-a-legend-without-adding-extra-traces/40436>\
**Category:** 📊 Plotly Python\
**Created:** [June 2, 2020, 9:52am UTC](https://community.plotly.com/t/slider-plot-with-legend-can-i-hard-code-a-legend-without-adding-extra-traces/40436 "2020-06-02T09:52:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeefyBarrier](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@BeefyBarrier](https://community.plotly.com/u/BeefyBarrier)\
**Post date:** [June 2, 2020, 9:52am UTC](https://community.plotly.com/t/slider-plot-with-legend-can-i-hard-code-a-legend-without-adding-extra-traces/40436/1 "2020-06-02T09:52:47Z")

</div>

I’ve made a plot with a slider. For each step in the slider a trace is required. All my traces consist of a bar plot with multiple colors, but this is ONE trace, it’s not what is considered a stacked bar plot, this consists of multiple traces. The problem is that one trace can only create one legend category. I could make a figure with multiple traces for more legend categories BUT if i try to do this, i will get a huge amount of steps since for every trace, there must be created a new step. Is there any way to for example hard-code a legend without having to implement a trace.
