Created
September 13, 2020 12:24
-
-
Save Duckuism/b5692f107514c2840a3e6cbbb3fa5c84 to your computer and use it in GitHub Desktop.
7
This file contains 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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
//VictorytTheme import | |
import { VictoryBar, VictoryChart, VictoryAxis, VictoryTheme } from "victory"; | |
const data = [ | |
{ quarter: 1, earnings: 13000 }, | |
{ quarter: 2, earnings: 16500 }, | |
{ quarter: 3, earnings: 14250 }, | |
{ quarter: 4, earnings: 19000 }, | |
]; | |
class Main extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h1>Victory Tutorial</h1> | |
//theme 속성 지정 | |
<VictoryChart domainPadding={30} theme={VictoryTheme.material}> | |
<VictoryAxis | |
tickValues={[1, 2, 3, 4]} | |
tickFormat={["Quarter 1", "Quarter 2", "Quarter 3", "Quarter 4"]} | |
/> | |
<VictoryAxis | |
dependentAxis | |
tickFormat={(x) => `$${x / 1000}k`} | |
/> | |
<VictoryBar data={data} x="quarter" y="earnings" /> | |
</VictoryChart> | |
</div> | |
); | |
} | |
} | |
const app = document.getElementById("app"); | |
ReactDOM.render(<Main />, app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment