Skip to content

Instantly share code, notes, and snippets.

@hujuu
Created March 14, 2023 09:25
Show Gist options
  • Save hujuu/c6bf48d45be4914a851d543cfc9be958 to your computer and use it in GitHub Desktop.
Save hujuu/c6bf48d45be4914a851d543cfc9be958 to your computer and use it in GitHub Desktop.
victoryで箱ひげ図を書く
"use client";
import React from "react";
import { VictoryPie, VictoryChart, VictoryBoxPlot, VictoryTheme } from "victory";
export default function PieChart(){
return (
<VictoryChart
domainPadding={20}
theme={VictoryTheme.grayscale}>
<VictoryBoxPlot
horizontal
boxWidth={10}
whiskerWidth={5}
data={[
{ x: 1, y: [1, 2, 3, 5] },
{ x: 2, y: [3, 2, 8, 10] },
{ x: 3, y: [2, 8, 6, 5] },
{ x: 4, y: [1, 3, 2, 9] }
]}
/>
</VictoryChart>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment