Created
June 13, 2020 17:31
-
-
Save gaurav5430/fe52e7b92505be20b5fef14687998d58 to your computer and use it in GitHub Desktop.
linechart example from Nivo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ResponsiveLine | |
data={data} | |
margin={{ top: 50, right: 110, bottom: 50, left: 60 }} | |
xScale={{ type: 'point' }} | |
yScale={{ type: 'linear', min: 'auto', max: 'auto', stacked: true, reverse: false }} | |
axisTop={null} | |
axisRight={null} | |
axisBottom={{ | |
orient: 'bottom', | |
tickSize: 5, | |
tickPadding: 5, | |
tickRotation: 0, | |
legend: 'transportation', | |
legendOffset: 36, | |
legendPosition: 'middle' | |
}} | |
axisLeft={{ | |
orient: 'left', | |
tickSize: 5, | |
tickPadding: 5, | |
tickRotation: 0, | |
legend: 'count', | |
legendOffset: -40, | |
legendPosition: 'middle' | |
}} | |
colors={{ scheme: 'nivo' }} | |
pointSize={10} | |
pointColor={{ theme: 'background' }} | |
pointBorderWidth={2} | |
pointBorderColor={{ from: 'serieColor' }} | |
pointLabel="y" | |
pointLabelYOffset={-12} | |
useMesh={true} | |
legends={[ | |
{ | |
anchor: 'bottom-right', | |
direction: 'column', | |
justify: false, | |
translateX: 100, | |
translateY: 0, | |
itemsSpacing: 0, | |
itemDirection: 'left-to-right', | |
itemWidth: 80, | |
itemHeight: 20, | |
itemOpacity: 0.75, | |
symbolSize: 12, | |
symbolShape: 'circle', | |
symbolBorderColor: 'rgba(0, 0, 0, .5)', | |
effects: [ | |
{ | |
on: 'hover', | |
style: { | |
itemBackground: 'rgba(0, 0, 0, .03)', | |
itemOpacity: 1 | |
} | |
} | |
] | |
} | |
]} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment