Skip to content

Instantly share code, notes, and snippets.

@zthomas
Created July 26, 2020 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zthomas/44e4366d00de09d93d52f77b41988623 to your computer and use it in GitHub Desktop.
Save zthomas/44e4366d00de09d93d52f77b41988623 to your computer and use it in GitHub Desktop.
React Google Charts - Material Bar Chart
<Chart
chartType="Bar"
data={[
['Year', 'Sales'],
['2014', 1000],
['2015', 1200],
['2014', 1000],
['2015', 1200],
['2014', 1000],
['2015', 1200],
['2014', 1000],
['2015', 1200],
['2014', 1000],
['2015', 1200],
]}
height="400px"
options={{
bars: 'vertical', // Required for Material Bar Charts.
backgroundColor: 'transparent',
tooltip: { trigger: 'none' },
legend: { position: 'none' },
colors: ['white'],
vAxis: {
format: 'currency',
},
}}
></Chart>
'svg rect': {
fill: 'none',
},
'svg path': {
fill: 'rgba(255,255,255, 0.2)',
},
'svg line': {
stroke: 'rgba(255,255,255, 0.2)',
strokeDasharray: 4,
},
'svg text': {
fill: 'white',
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment