1.0.6 • Published 3 years ago
@stiansjoli/barchart v1.0.6
Introduction
This project is just a test to see how to create a bar chart as a webcomponent.
Getting Started
npm install @stiansjoli/barchart
In an appropriate project file (for instance index.js):
import @stiansjoli/barchart
How to use
Example
<html>
<head>
<style>
bar-chart {
font-size: 1.5em;
fill:teal;
--text-fill:black;
}
</style>
</head>
<body>
<bar-chart
data='[{"brand":"Ford","count":2},{"brand":"Toyota","count":7}, {"brand":"Nissan","count":1}, {"brand":"BMW","count":5}]'
x-attribute-name="brand"
y-attribute-name="count"
x-label="Brands"
y-label="Count"
width="700"
height="500"
> </bar-chart>
</body>
</html>