我正在尝试保存一个简单的性能摘要图,并希望有一种方法可以将条形图的周期从月收益更改为年收益。
我已经浏览了软件包(https://cran.r-project.org/web/packages/PerformanceAnalytics/vignettes/PA-charts.pdf)的文档,但是他们没有任何有用的信息
import React, { useState, useEffect, useRef } from "react";
import { useTableState } from "react-table";
import { Button } from "../Styles";
import Table from "../TransactionPanelTable";
// Simulate a server
const getServerData = async ({ filters, sortBy, pageSize, pageIndex }) => {
await new Promise(resolve => setTimeout(resolve, 500));
const filtersArr = Object.entries(filters);
let rows = [];
for (let i = 0; i < 1000; i++) {
rows.push({
transaction_seq: 1234,
rec_count: 1234,
user_id: "test",
updated_at: "",
duration: 1.23
});
}
// Apply Filters
if (filtersArr.length) {
rows = rows.filter(row =>
filtersArr.every(([key, value]) => row[key].includes(value))
);
}
// Apply Sorting
if (sortBy.length) {
const [{ id, desc }] = sortBy;
rows = [...rows].sort(
(a, b) => (a[id] > b[id] ? 1 : a[id] === b[id] ? 0 : -1) * (desc ? -1 : 1)
);
}
// Get page counts
const pageCount = Math.ceil(rows.length / pageSize);
const rowStart = pageSize * pageIndex;
const rowEnd = rowStart + pageSize;
// Get the current page
rows = rows.slice(rowStart, rowEnd);
return {
rows,
pageCount
};
};
const columns = [
{
Header: "Rejected Transaction(s)",
className: "left",
columns: [
{
**id: "checkbox",
accessor: "",
Cell: ({ original }) => {
return (
<input
type="checkbox"
className="checkbox"
checked={() => }
onChange={() => test()}
/>
);
},
Header: x => {
return (
<input
type="checkbox"
className="checkbox"
//checked={this.state.selectAll === 1}
//ref={input => {
//if (input) {
//input.indeterminate = this.state.selectAll === 2;
// }
//}}
//onChange={() => this.toggleSelectAll()}
/>
);**
},
sortable: false,
width: 45
},
这是我目前拥有的东西,但是我在包装中找不到任何可以更改此方面的内容。截至目前,每月都是回报。