Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard #55

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .history/components/ChartContributionTotal_20210102233531.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Line } from "react-chartjs-2";
import moment from "moment";
import "moment/locale/nl";
import "chartjs-adapter-moment";

moment.locale("pt-BR");

export const ChartContribution = ({ result }: any) => {

const labels = [];
const values = [];

for (const v of result) {
labels.push(v["day"]);
values.push(v["accumulated"]);
}

// const label = Array.from(result["day"]).map(() => 0);
// console.log(label);

const data = {
chartData: {
labels: labels,
datasets: [
{
label: "Total Captado",
data: values,
borderColor: "rgb(0,212,255)",
},
],
},
};

return (
<div className="line-chart">
<article className="canvas-container">
<Line
data={data.chartData}
width={800}
height={400}
options={{
responsive: true,
maintainAspectRatio: false,
title: {
display: true,
fontColor: "rgb(250,250,250)",
text: "Contribuições Acumuladas",
fontSize: 25,
},
legend: {
display: true,
position: "top",
align: "end",
usePointStyle: "true",
},
scales: {
yAxes: [
{
scaleLabel: {
display: true,
fontColor: "rgb(250,250,250)",
labelString: "Valor (R$)",
},
},
],
xAxes: [
{
display: true,
type: "time",
time: {
parser: "YYYY-MM-DDTHH:mm:ss.SSS",
unit: "day",
// unitStepSize: 1,
displayFormats: { day: "D MMM" },
},
},
],
},
}}
/>
</article>
</div>
);
};

export default ChartContribution;
86 changes: 86 additions & 0 deletions .history/components/ChartContributionTotal_20210103000031.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Line } from "react-chartjs-2";
import moment from "moment";
import "moment/locale/nl";
import "chartjs-adapter-moment";

moment.locale("pt-BR");

export const ChartContribution = ({ result }: any) => {

const labels = [];
const values = [];

for (const v of result) {
labels.push(v["day"]);
values.push(v["accumulated"]);
}

// const label = Array.from(result["day"]).map(() => 0);
// console.log(label);

const data = {
chartData: {
labels: labels,
datasets: [
{
label: "Total Captado",
data: values,
borderColor: "rgb(0,212,255)",
},
],
},
};

return (
<div className="line-chart">
<article className="canvas-container">
<Line
data={data.chartData}
width={800}
height={400}
options={{
responsive: true,
maintainAspectRatio: false,
title: {
display: true,
fontColor: "rgb(250,250,250)",
text: "Contribuições Acumuladas",
fontSize: 25,
},
legend: {
display: true,
position: "top",
align: "end",
usePointStyle: "true",
},
scales: {
yAxes: [
{
scaleLabel: {
display: true,
fontColor: "rgb(250,250,250)",
labelString: "Valor (R$)",
},
},
],
xAxes: [
{
display: true,
type: "time",
time: {
parser: "YYYY-MM-DDTHH:mm:ss.SSS",
unit: "day",
// unitStepSize: 1,
displayFormats: { day: "D MMM" },
},
},
],
},
}}
/>
</article>
</div>
);
};

export default ChartContribution;
86 changes: 86 additions & 0 deletions .history/components/ChartContributionTotal_20210103000032.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Line } from "react-chartjs-2";
import moment from "moment";
import "moment/locale/nl";
import "chartjs-adapter-moment";

moment.locale("pt-BR");

export const ChartContribution = ({ result }: any) => {

const labels = [];
const values = [];

for (const v of result) {
labels.push(v["day"]);
values.push(v["accumulated"]);
}

// const label = Array.from(result["day"]).map(() => 0);
// console.log(label);

const data = {
chartData: {
labels: labels,
datasets: [
{
label: "Total Captado",
data: values,
borderColor: "rgb(0,212,255)",
},
],
},
};

return (
<div className="line-chart">
<article className="canvas-container">
<Line
data={data.chartData}
width={800}
height={400}
options={{
responsive: true,
maintainAspectRatio: false,
title: {
display: true,
fontColor: "rgb(250,250,250)",
text: "Contribuições Acumuladas",
fontSize: 25,
},
legend: {
display: true,
position: "top",
align: "end",
usePointStyle: "true",
},
scales: {
yAxes: [
{
scaleLabel: {
display: true,
fontColor: "rgb(250,250,250)",
labelString: "Valor (R$)",
},
},
],
xAxes: [
{
display: true,
type: "time",
time: {
parser: "YYYY-MM-DDTHH:mm:ss.SSS",
unit: "day",
// unitStepSize: 1,
displayFormats: { day: "D MMM" },
},
},
],
},
}}
/>
</article>
</div>
);
};

export default ChartContribution;
86 changes: 86 additions & 0 deletions .history/components/ChartContributionTotal_20210103000033.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Line } from "react-chartjs-2";
import moment from "moment";
import "moment/locale/nl";
import "chartjs-adapter-moment";

moment.locale("pt-BR");

export const ChartContribution = ({ result }: any) => {

const labels = [];
const values = [];

for (const v of result) {
labels.push(v["day"]);
values.push(v["accumulated"]);
}

// const label = Array.from(result["day"]).map(() => 0);
// console.log(label);

const data = {
chartData: {
labels: labels,
datasets: [
{
label: "Total Captado",
data: values,
borderColor: "rgb(0,212,255)",
},
],
},
};

return (
<div className="line-chart">
<article className="canvas-container">
<Line
data={data.chartData}
width={800}
height={400}
options={{
responsive: true,
maintainAspectRatio: false,
title: {
display: true,
fontColor: "rgb(250,250,250)",
text: "Contribuições Acumuladas",
fontSize: 25,
},
legend: {
display: true,
position: "top",
align: "end",
usePointStyle: "true",
},
scales: {
yAxes: [
{
scaleLabel: {
display: true,
fontColor: "rgb(250,250,250)",
labelString: "Valor (R$)",
},
},
],
xAxes: [
{
display: true,
type: "time",
time: {
parser: "YYYY-MM-DDTHH:mm:ss.SSS",
unit: "day",
// unitStepSize: 1,
displayFormats: { day: "D MMM" },
},
},
],
},
}}
/>
</article>
</div>
);
};

export default ChartContribution;
30 changes: 30 additions & 0 deletions .history/middlewares/messageMiddleware_20201223232201.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// import {default as messages} from "../pages/strings/pt/messages.json";
import * as Messages from "../pages/strings/pt/messages.json";

const defaultLocale = "pt";

export async function getMessage(key: string): Promise<any> {
if (key == undefined){
console.log(`could not look up message with key ${key}`);
// else console.log(`Não foi possível encontrar a mensagem com a chave ${key}`); }
} else {
return key;
}

}

// const getMessage = async (key: string) => {
// let locale = "pt"
// try {
// return require(`../pages/strings/${locale}/messages.json`)
// } catch (error) {
// console.error(error)
// return require(`../pages/strings/${locale}/messages.json`)
// }
// }

// export default getMessage

// console.log(getMessage("invalid_data)");

export default getMessage;
Loading