-
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.
Merge pull request #300 from consensusnetworks/new-app-design
New app design
- Loading branch information
Showing
46 changed files
with
2,098 additions
and
2,045 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<script lang="ts" setup> | ||
import { ref, onMounted } from 'vue' | ||
import Chart, { ChartItem } from 'chart.js/auto' | ||
// eslint-disable-next-line no-undef | ||
const props = defineProps({ | ||
id: { | ||
type: String, | ||
required: true, | ||
}, | ||
legend: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
xGridLines: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
yGridLines: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}) | ||
const chart = ref(null as any) | ||
onMounted(() => { | ||
chart.value = new Chart(document.getElementById(props.id) as ChartItem , { | ||
type : 'line', | ||
data : { | ||
labels : [ 'Jan 22', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', | ||
'Sep', 'Oct', 'Nov', 'Dec', 'Jan 23', 'Feb', 'Mar' ], | ||
datasets : [ | ||
{ | ||
data : [ 186, 205, 1321, 1516, 2107, 5478, 186, 205, | ||
2191, 3133, 3221, 4783, 5478, 186, 205 ], | ||
label : 'Net Value', | ||
borderColor : '#C1D3F8', | ||
fill: false, | ||
tension: 0.4, | ||
}] | ||
}, | ||
options : { | ||
responsive: true, | ||
plugins: { | ||
legend: { | ||
display: props.legend, | ||
} | ||
}, | ||
interaction: { | ||
intersect: false, | ||
}, | ||
scales: { | ||
x: { | ||
border: { | ||
display: true, | ||
color: '#BFBFBF' | ||
}, | ||
grid: { | ||
display: props.xGridLines, | ||
drawTicks: true, | ||
color: '#F2F2F2' | ||
} | ||
}, | ||
y: { | ||
border: { | ||
display: true, | ||
color: '#BFBFBF' | ||
}, | ||
grid: { | ||
display: props.yGridLines, | ||
drawTicks: true, | ||
color: '#F2F2F2' | ||
}, | ||
} | ||
} | ||
} | ||
}) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<canvas | ||
:id="props.id" | ||
class="w-full h-full" | ||
/> | ||
</div> | ||
</template> |
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
Oops, something went wrong.