0.3.0 • Published 12 months ago

@ngyewch/chartjs-v4-webcomponent v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

npm GitHub Workflow Status GitHub last commit

chartjs-v4-webcomponent

Simple web component for displaying Chart.js v4 charts.

Usage

Import

Script tag:

<script type="module" src="https://cdn.jsdelivr.net/npm/@ngyewch/chartjs-v4-webcomponent@0.3.0/dist/chartjs-v4-webcomponent.js"></script>

Markup

    <chartjs-v4>
        <script type="application/json">
            {
                "type": "bar",
                "data": {
                    "labels": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
                    "datasets": [
                        {
                            "label": "My First Dataset",
                            "data": [65, 59, 80, 81, 56, 55, 40]
                        }
                    ]
                },
                "options": {
                    "maintainAspectRatio": false,
                    "scales": {
                        "y": {
                            "beginAtZero": true
                        }
                    }
                }
            }
        </script>
    </chartjs-v4>
0.3.0

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago