Skip to content

Instantly share code, notes, and snippets.

@jokamjohn
Last active May 3, 2020 10:39
Show Gist options
  • Save jokamjohn/02ac520fa5aebdc3722cc5a900a8598c to your computer and use it in GitHub Desktop.
Save jokamjohn/02ac520fa5aebdc3722cc5a900a8598c to your computer and use it in GitHub Desktop.
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