Last active
May 3, 2020 10:39
-
-
Save jokamjohn/02ac520fa5aebdc3722cc5a900a8598c to your computer and use it in GitHub Desktop.
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 styled from "styled-components"; | |
import { VictoryChart, VictoryBar, VictoryTooltip } from "victory"; | |
const Container = styled("div")` | |
font-family: sans-serif; | |
text-align: center; | |
`; | |
const data = [ | |
{name: 'John', score: 20, label: 'label one'}, | |
{name: 'Joe', score: 10, label: 'label two'}, | |
{name: 'Jos', score: 30, label: 'label three'}, | |
{name: 'Joy', score: 15, label: 'label four'}, | |
{name: 'Joan', score: 40, label: 'label five'}, | |
{name: 'Johnny', score: 50, label: 'label six'}, | |
]; | |
export default function App() { | |
return ( | |
<Container> | |
<h1>VictoryTooltip</h1> | |
<VictoryChart> | |
<VictoryBar | |
data={data} | |
x="score" | |
y="name" | |
/> | |
</VictoryChart> | |
</Container> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment