-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial basic support for Victory
Fixes #41
- Loading branch information
Showing
13 changed files
with
106 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
File renamed without changes
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
Binary file not shown.
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import ReactPDFChart from '../src'; | ||
import { Document, Page } from '@react-pdf/renderer'; | ||
import ReactPDF from '@react-pdf/renderer'; | ||
import { fileURLToPath } from 'node:url'; | ||
import React from 'react'; | ||
import { VictoryBar, VictoryChart } from 'victory'; | ||
|
||
const data = [ | ||
{ x: 1, y: 2, y0: 1 }, | ||
{ x: 2, y: 3, y0: 2 }, | ||
{ x: 3, y: 5, y0: 2 }, | ||
{ x: 4, y: 4, y0: 3 }, | ||
{ x: 5, y: 6, y0: 3 }, | ||
]; | ||
|
||
const MyDocument = () => ( | ||
<Document> | ||
<Page size='A4' style={{ padding: 20 }}> | ||
<ReactPDFChart> | ||
<VictoryChart> | ||
<VictoryBar | ||
data={data} | ||
height={100} | ||
style={{ data: { fill: '#c43a31' } }} | ||
width={100} | ||
/> | ||
</VictoryChart> | ||
</ReactPDFChart> | ||
</Page> | ||
</Document> | ||
); | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
ReactPDF.render(<MyDocument />, `${__dirname}/victory-basic.pdf`); |
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
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