zakodium-oss / react-plot

Library of React components to render SVG 2D plots. You can check the story book https://react-plot.pages.dev/ or have a look to the extensive documentation
https://react-plot.zakodium.com
MIT License
12 stars 6 forks source link

legend bug #428

Closed wadjih-bencheikh18 closed 2 years ago

wadjih-bencheikh18 commented 2 years ago

when using function series under bar series the legend of this latter does not appear

 <Plot {...DEFAULT_PLOT_CONFIG}>
      <Legend {...props} labelStyle={{ cursor: 'hand' }} />
      <BarSeries
        data={data2}
        lineStyle={{
          stroke: 'green',
        }}
        label="Label Bar series"
      />
      <FunctionSeries
        getY={(x) => 5 * Math.sin(x) + 10}
        lineStyle={{
          stroke: 'brown',
        }}
        label="Label Function series"
      />
    </Plot>

image

but if we reverse it works correctly