Skip to content

Instantly share code, notes, and snippets.

@Duckuism
Last active September 13, 2020 12:51
Show Gist options
  • Save Duckuism/1dc96ff6b37a73b2b2e58ba17dc21cc3 to your computer and use it in GitHub Desktop.
Save Duckuism/1dc96ff6b37a73b2b2e58ba17dc21cc3 to your computer and use it in GitHub Desktop.
5
import React from "react";
import ReactDOM from "react-dom";
//VictoryChart import
import { VictoryBar, VictoryChart } 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>
//VictoryChart 컴포넌트로 VictoryBar 컴포넌트를 감싼다.
<VictoryChart>
<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