-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.astro
95 lines (92 loc) · 1.75 KB
/
index.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
import Layout from "../layouts/Layout.astro";
import AstroBarChart from "astro-barchart";
const data = [
{
key: 2000,
value: 10,
},
{
key: 2001,
value: 5,
},
{
key: 2002,
value: 4,
},
{
key: 2003,
value: 9,
},
{
key: 2004,
value: 1,
},
{
key: 2005,
value: 3,
},
{
key: 2006,
value: 2,
},
{
key: 2007,
value: 6,
},
{
key: 2008,
value: 7,
},
];
---
<Layout title="astro-barchart demo">
<div>
<h1>astro-barchart</h1>
<a href="https://www.npmjs.com/package/astro-barchart" target="_blank">
<img src="https://img.shields.io/npm/d18m/astro-barchart.svg" />
<img src="https://img.shields.io/npm/v/astro-barchart" />
</a>
<a href="https://www.npmjs.com/package/astro-barchart" target="_blank">
<div>
<code>npm i astro-barchart</code>
</div>
</a>
<a href="https://github.com/Its-Just-Nans/astro-barchart">https://github.com/Its-Just-Nans/astro-barchart</a>
</div>
<br />
<div class="chart">
<AstroBarChart
data={data}
title="astro-barchart demo"
xLabel="Years"
yLabel="Values per year"
keyVal="value"
nameVal="key"
tooltip=":key in :name"
yHelpers={data.length}
xHelpers={4}
/>
</div>
<div>
<span>this demo code at</span>
<a href="https://github.com/Its-Just-Nans/astro-barchart/blob/main/demo/src/pages/index.astro">
https://github.com/Its-Just-Nans/astro-barchart/blob/main/demo/src/pages/index.astro
</a>
</div>
</Layout>
<style>
.chart {
margin: auto;
max-width: 55%;
}
div {
text-align: center;
}
code {
background-color: lightgray;
padding: 10px;
margin: 10px;
display: inline-block;
}
</style>