All Projects → fusioncharts → angular-fusioncharts

fusioncharts / angular-fusioncharts

Licence: MIT license
Angular Component for FusionCharts JavaScript Charting Library

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to angular-fusioncharts

fusioncharts-dist
FusionCharts JavaScript Charting library. Over 95+ charts and 1,400+ maps to choose from, with integrations available for all popular JavaScript frameworks & back-end programming languages.
Stars: ✭ 65 (+22.64%)
Mutual labels:  charts, dataviz, graphs, dashboards, data-stories, javascript-charts, js-charts
React Fusioncharts Component
ReactJS component for FusionCharts JavaScript Charting library.
Stars: ✭ 73 (+37.74%)
Mutual labels:  charts, dataviz, graphs, dashboards
React Jsx Highcharts
Highcharts built with proper React components
Stars: ✭ 336 (+533.96%)
Mutual labels:  charts, dataviz, graphs
silky-charts
A silky smooth D3/React library
Stars: ✭ 38 (-28.3%)
Mutual labels:  charts, dataviz, graphs
Keen Js
https://keen.io/ JavaScript SDKs. Track users and visualise the results. Demo http://keen.github.io/keen-dataviz.js/
Stars: ✭ 588 (+1009.43%)
Mutual labels:  charts, dataviz, dashboards
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (+286.79%)
Mutual labels:  charts, graphs
Keen Dataviz.js
Data Visualization Charting Library
Stars: ✭ 215 (+305.66%)
Mutual labels:  charts, dataviz
scalajs-highcharts
Scala.js static typed facades for Highcharts library
Stars: ✭ 30 (-43.4%)
Mutual labels:  charts, graphs
Samples-JS-PHP
JavaScript and PHP samples for Stimulsoft Reports.PHP reporting tool.
Stars: ✭ 17 (-67.92%)
Mutual labels:  charts, dashboards
Matplotplusplus
Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
Stars: ✭ 2,433 (+4490.57%)
Mutual labels:  charts, graphs
hacktoberfest-data
Generating stats from the raw Hacktoberfest application data.
Stars: ✭ 21 (-60.38%)
Mutual labels:  charts, graphs
datalith
Simple, batteries included, components to build beautiful data visualizations
Stars: ✭ 29 (-45.28%)
Mutual labels:  charts, dataviz
Reactjs Adminlte
ReactJS version of the original AdminLTE dashboard (EXPERIMENTAL)- https://github.com/almasaeed2010/AdminLTE
Stars: ✭ 2,292 (+4224.53%)
Mutual labels:  charts, dashboards
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+4307.55%)
Mutual labels:  charts, graphs
echarty
Minimal R/Shiny Interface to ECharts.js
Stars: ✭ 49 (-7.55%)
Mutual labels:  charts, graphs
Charts
⚡ Laravel Charts — Build charts using laravel. The laravel adapter for Chartisan.
Stars: ✭ 2,337 (+4309.43%)
Mutual labels:  charts, interactive-charts
FlowViz
A Power BI template that provides easy to understand, actionable flow metrics and predictive analytics for your agile teams using Azure DevOps, Azure DevOps Server and/or TFS.
Stars: ✭ 150 (+183.02%)
Mutual labels:  charts, dataviz
dash-lollapalooza-brasil-2018
🎟Using Plotly to visualize data from Lollapalooza
Stars: ✭ 23 (-56.6%)
Mutual labels:  charts, dataviz
LineChartView
An interactive line chart written in SwiftUI with many customizations (colors, line size, dots, haptic feedbacks). Support value and time series.
Stars: ✭ 59 (+11.32%)
Mutual labels:  charts, interactive-charts
online-retail-dashboard
Online Retail Dashboard
Stars: ✭ 59 (+11.32%)
Mutual labels:  charts, fusioncharts

angular-fusioncharts

A simple and lightweight official Angular component for FusionCharts JavaScript charting library. angular-fusioncharts enables you to add JavaScript charts in your Angular application without any hassle.

Demo


Validation and Verification

The FusionCharts Angular integration component has been verified and validated with different versions of Fusioncharts (3.19 / 3.18 / 3.17) with Angular versions 11/12/13

Table of Contents

Getting Started

Requirements

  • Node.js, NPM/Yarn installed globally in your OS.
  • You've an Angular Application.
  • FusionCharts installed in your project, as detailed below:

Installation

To install angular-fusioncharts library, run:

$ npm install angular-fusioncharts --save

To install fusioncharts library:

$ npm install fusioncharts --save

Quick Start

Here is a basic sample that shows how to create a chart using angular-fusioncharts:

Add this in your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import angular-fusioncharts
import { FusionChartsModule } from 'angular-fusioncharts';

// Import FusionCharts library and chart modules
import * as FusionCharts from 'fusioncharts';
import * as Charts from 'fusioncharts/fusioncharts.charts';

// For Powercharts , Widgets, and Maps
// import * as PowerCharts from 'fusioncharts/fusioncharts.powercharts';
// import * as Widgets from 'fusioncharts/fusioncharts.widgets';
// import * as Maps from 'fusioncharts/fusioncharts.maps';
// To know more about suites,
// read this https://www.fusioncharts.com/dev/getting-started/plain-javascript/install-using-plain-javascript

// For Map definition files
// import * as World from 'fusioncharts/maps/fusioncharts.world';

import * as FusionTheme from 'fusioncharts/themes/fusioncharts.theme.fusion';

// Pass the fusioncharts library and chart modules
FusionChartsModule.fcRoot(FusionCharts, Charts, FusionTheme);

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    // Specify FusionChartsModule as import
    FusionChartsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

Once the library is imported, you can use its components, directives in your Angular application:

In your Angular AppComponent:

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html'
})
export class AppComponent {
  dataSource: Object;
  title: string;

  constructor() {
    this.title = 'Angular  FusionCharts Sample';

    this.dataSource = {
      chart: {
        caption: 'Countries With Most Oil Reserves [2017-18]',
        subCaption: 'In MMbbl = One Million barrels',
        xAxisName: 'Country',
        yAxisName: 'Reserves (MMbbl)',
        numberSuffix: 'K',
        theme: 'fusion'
      },
      data: [
        { label: 'Venezuela', value: '290' },
        { label: 'Saudi', value: '260' },
        { label: 'Canada', value: '180' },
        { label: 'Iran', value: '140' },
        { label: 'Russia', value: '115' },
        { label: 'UAE', value: '100' },
        { label: 'US', value: '30' },
        { label: 'China', value: '30' }
      ]
    };
  }
}
<!-- You can now use fusioncharts component in app.component.html -->
<h1>
  {{title}}
</h1>
<fusioncharts
    width="600"
    height="350"
    type="Column2D"
    dataFormat="JSON"
    [dataSource]="dataSource"
></fusioncharts>

Working with Events

Fusincharts events can be subscribed from component's output params.
Usage in template :

<fusioncharts
  width="600"
  height="350"
  type="Column2D"
  dataFormat="json"
  [dataSource]="dataSource"
  (dataplotRollOver)="plotRollOver($event)">
</fusioncharts>

And in component's code , $event will be an object { eventObj : {...}, dataObj: {...} }
For more on this read here

import {Component} from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html'
})
export class AppComponent {
  dataSource: Object;
  title: string;

  constructor() {
    this.title = "Angular  FusionCharts Sample";

    this.dataSource = {
      ...// same data as above
    };
  }



  plotRollOver($event){
    var dataValue = $event.dataObj.dataValue;
    console.log(`Value is ${dataValue}`);
  }

}

Get the list of fusioncharts' events

Working with APIs

Using api of charts involves getting the FusionCharts chart instance from the initialized event. It emits chart object which can be operated upon later.

In template, we add initialized event

<fusioncharts
  type="column2d"
  width="100%"
  height="400"
  dataFormat="json"
  [dataSource]="dataSource"
  (initialized)="initialized($event)">
</fusioncharts>
<button (click)="changeLabel()">Change label</button>

And in component's code , we get $event as { chart : ChartInstance }

So in order to use the chart instance , we need to store the chart instance.

import {Component} from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html'
})
export class AppComponent {
  dataSource: Object;
  title: string;
  chart: any;
  constructor() {
    this.title = "Angular  FusionCharts Sample";

    this.dataSource = {
      ...// same data as above
    };
  }

  initialized($event){
    this.chart = $event.chart; // Storing the chart instance
  }

  changeLabel(){
    this.chart.setChartAttribute('caption', 'Changed caption');
  }

}

Usage and integration of FusionTime

From [email protected] and [email protected], You can visualize timeseries data easily with angular.

Learn more about FusionTime here.

Setup for FusionTime

// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import angular-fusioncharts
import { FusionChartsModule } from 'angular-fusioncharts';
// Import FusionCharts library and chart modules
import * as FusionCharts from 'fusioncharts';
import * as Charts from 'fusioncharts/fusioncharts.charts';
import * as TimeSeries from 'fusioncharts/fusioncharts.timeseries'; // Import timeseries
// Pass the fusioncharts library and chart modules
FusionChartsModule.fcRoot(FusionCharts, Charts, TimeSeries);
@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    // Specify FusionChartsModule as import
    FusionChartsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

Component code

// In app.component.ts
import { Component } from '@angular/core';
import * as FusionCharts from 'fusioncharts';
const dataUrl =
  'https://raw.githubusercontent.com/fusioncharts/dev_centre_docs/fusiontime-beta-release/charts-resources/fusiontime/online-sales-single-series/data.json';
const schemaUrl =
  'https://raw.githubusercontent.com/fusioncharts/dev_centre_docs/fusiontime-beta-release/charts-resources/fusiontime/online-sales-single-series/schema.json';
@Component({
  selector: 'app',
  templateUrl: './app.component.html'
})
export class AppComponent {
  dataSource: any;
  type: string;
  width: string;
  height: string;
  constructor() {
    this.type = 'timeseries';
    this.width = '400';
    this.height = '400';
    this.dataSource = {
      data: null,
      yAxis: {
        plot: [{ value: 'Sales' }]
      },
      caption: {
        text: 'Online Sales of a SuperStore in the US'
      }
    };
    this.fetchData();
  }
  fetchData() {
    let jsonify = res => res.json();
    let dataFetch = fetch(dataUrl).then(jsonify);
    let schemaFetch = fetch(schemaUrl).then(jsonify);
    Promise.all([dataFetch, schemaFetch]).then(res => {
      let data = res[0];
      let schema = res[1];
      let fusionTable = new FusionCharts.DataStore().createDataTable(
        data,
        schema
      ); // Instance of DataTable to be passed as data in dataSource
      this.dataSource.data = fusionTable;
    });
  }
}

Template Code

<div>
  <fusioncharts
    [type]="type"
    [width]="width"
    [height]="height"
    [dataSource]="dataSource"
  ></fusioncharts>
</div>

Useful links for FusionTime

For Contributors

  • Clone the repository and install dependencies
$ git clone https://github.com/fusioncharts/angular-fusioncharts.git
$ cd angular-fusioncharts
$ npm i
$ npm start
$ npm run build 

  • For publishing
$ npm run build
$ npm publish dist

Going Beyond Charts

  • Explore 20+ pre-built business specific dashboards for different industries like energy and manufacturing to business functions like sales, marketing and operations here.
  • See Data Stories built using FusionCharts’ interactive JavaScript visualizations and learn how to communicate real-world narratives through underlying data to tell compelling stories.

Licensing

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].