web-component-amazing-chart

1.0.5 • Public • Published

Web Component Amazing Chart

NPM License

Lightweight stock line chart < 15k 😎
Compatible with React, Vue, Angular & other frameworks. Optional animation.

amazing-chart

Vue usage

npm i web-component-amazing-chart

main.js

import AmazingChart from "web-component-amazing-chart";

customElements.define('amazing-chart', AmazingChart);

App.vue

onMounted(() => {
  let amazingChartElement = document.querySelector('#amazing-chart');
  amazingChartElement.options = {
      data: [
        { time: 1672084591000, price: 5 }, { time: 1674762991000, price: 6 },
        { time: 1677441391000, price: 5 }, { time: 1679860591000, price: 6 },
        ....
      ],
      animate: true,
    };

});

<template>
<amazing-chart id="amazing-chart"/>
</template

vite config:

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag.includes('amazing-chart')
        }
      }
    })
  ],

Contact

hi@giladshohat.com 💫

Package Sidebar

Install

npm i web-component-amazing-chart

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

14.7 kB

Total Files

4

Last publish

Collaborators

  • gshohat