npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-froalacharts

v1.0.1

Published

Simple and lightweight official Vue component for FroalaCharts.

Downloads

8

Readme

vue-froalacharts

Simple and lightweight Vue component for FroalaCharts. vue-froalacharts enables you to add JavaScript charts in your Vue application or project without any hassle.


Table of Contents

Getting Started

Requirements

  • Node.js, NPM/Yarn installed globally in your OS.
  • FroalaCharts and Vue installed in your project, as detailed below:

Installation

Direct Download All binaries are located on our github repository.

Install from NPM

npm install vue-froalacharts --save

Install from Yarn

yarn add vue-froalacharts

Include in your script

Download vue-froalacharts.js and include it in the HTML <script> tag.

<script src="vue-froalacharts.js" type="text/javascript"></script>

Usage

There are two ways of adding vue-froalacharts component in your project

Registering globally as a plugin Import vue, vue-froalacharts and FroalaCharts in main app file.

import Vue from `vue`;
import VueFroalaCharts from 'vue-froalacharts';

// import FroalaCharts modules and resolve dependency
import FroalaCharts from 'froalacharts';

Now, register it as plugin in Vue object

Vue.use(VueFroalaCharts, FroalaCharts);

This way is recommended when you want component (vue-froalacharts ) available from everywhere in your app.

Registering locally in your component Import the chart component from vue-froalacharts/component package in your component file and use Vue.component to register it locally.

import Vue from `vue`;
import VueFroalaChartsComponent from 'vue-froalacharts/component';

// import FroalaCharts modules and resolve dependency
import FroalaCharts from 'froalacharts';

const vueFroalaCharts = VueFroalaChartsComponent(FroalaCharts);

Vue.component('froalacharts', vueFroalaCharts);

This way is recommended when you want component (vue-froalacharts ) only in specific components of your app.

Where eventName can be any FroalaCharts event. You can find the list of events at froalacharts docs

Quick Start

Here is a basic sample that shows how to create a chart using vue-froalacharts:

import Vue from 'vue';
import VueFroalaCharts from 'vue-froalacharts';
import FroalaCharts from 'froalacharts';

// register VueFroalaCharts component
Vue.use(VueFroalaCharts, FroalaCharts);

const myDataSource = {
  chart: {
    caption: 'Recommended Portfolio Split',
    subCaption: 'For a net-worth of $1M',
    showValues: '1',
    showPercentInTooltip: '0',
    numberPrefix: '$',
    enableMultiSlicing: '1',
    theme: 'froala'
  },
  data: [
    {
      label: 'Equity',
      value: '300000'
    },
    {
      label: 'Debt',
      value: '230000'
    },
    {
      label: 'Bullion',
      value: '180000'
    },
    {
      label: 'Real-estate',
      value: '270000'
    },
    {
      label: 'Insurance',
      value: '20000'
    }
  ]
};

const chart = new Vue({
  el: '#app',
  data: {
    type: 'pie',
    width: '500',
    height: '300',
    dataFormat: 'json',
    dataSource: myDataSource
  }
});

Here's HTML template for the above example:

<div id="app">
  <froalacharts
    :type="type"
    :width="width"
    :height="height"
    :dataFormat="dataFormat"
    :dataSource="dataSource"
  >
  </froalacharts>
</div>

links to help you get started:

For Contributors

  • Clone the repository and install dependencies
$ git clone https://github.com/froala/vue-froalacharts.git
$ cd vue-froalacharts
$ npm install

Licensing

The FroalaCharts Vue component is open-source and distributed under the terms of the MIT/X11 License. However, you will need to download and include FroalaCharts library in your page separately, which has a separate license.