Skip to content

Commit

Permalink
feat: move legend to the left
Browse files Browse the repository at this point in the history
  • Loading branch information
MIGUELez11 committed Jan 22, 2024
1 parent d774516 commit 6b76fe0
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,26 @@ const ActivityAnswersBar = ({
colors={['#50B579', '#DC5571', '#B9BEC4']}
animate={false}
layers={['axes', 'bars', 'grid', 'markers', 'legends']}
legends={[
{
dataFrom: 'keys',
anchor: 'bottom-left',
direction: 'row',
justify: false,
translateX: withLegend ? 0 : -4000,
translateY: 70,
itemsSpacing: 2,
itemWidth: 100,
itemHeight: 20,
itemDirection: 'left-to-right',
symbolSize: 20,
symbolShape: CustomLegend,
},
]}
legends={
!withLegend
? []
: [
{
dataFrom: 'keys',
anchor: 'bottom-left',
direction: 'row',
justify: false,
translateX: -(longestKeyCharacters * MARGIN_FOR_CHAR + 18),
translateY: 70,
itemsSpacing: 2,
itemWidth: 100,
itemHeight: 20,
itemDirection: 'left-to-right',
symbolSize: 20,
symbolShape: CustomLegend,
},
]
}
legendLabel={getLegends}
axisBottom={{ tickSize: 0, tickPadding: 10, tickValues: getMaxValue() }}
axisLeft={{
Expand Down

0 comments on commit 6b76fe0

Please sign in to comment.