Flutter package for creating simple yet modern looking charts

Related tags

Charts modern_charts
Overview

A package for creating simple yet modern looking charts.

Five chart types

  • Bar

  • Gauge

  • Line

  • Pie

  • Radar

Canvas + DOM

modern_charts combines Canvas and DOM to achieve the best performance and experience.

  • Canvas is used to render chart contents (axes, grids, and series)
  • DOM is used to create legends and tooltips

DataTable

Data are passed to a chart via a DataTable object. By using DataTable, you can flexibly modify the data even after the chart has been rendered.

Animations

Animations are supported for different types of data modifications:

  • New data table
  • Changes to data table values
  • Insertion and removal of rows (categories)
  • Insertion and removal of columns (series)
  • Series visibility toggle

Responsive

Charts automatically resize when the browser is resized.

Interactive

  • Shows tooltips on hover/tap
  • The visibility of a series is toggled when you click the corresponding legend item

Modular

Each chart type has its own class, so your final production code only contains the code of the chart types you use.

Usage

Please read the wiki for instructions on how to use these beautiful charts.

Comments
  • AngularDart Error EXCEPTION: NoSuchMethodError: invalid member on null: 'length'

    AngularDart Error EXCEPTION: NoSuchMethodError: invalid member on null: 'length'

    Modern charts does not display the chart, but the legends are shown. kindly see the image attached. I've also attached the browser console logs. Thank you.

    Environment Dart Version : Dart VM version: 2.1.0 (Tue Nov 13 18:22:02 2018 +0100) on "macos_x64" modern_charts: ^0.1.16 angular: ^5.0.0

    browser-console-error.log error

    import 'package:angular/angular.dart';
    import 'package:modern_charts/modern_charts.dart';
    import 'dart:html';
    @Component(
        selector: 'dashboard',
        styleUrls: ['dashboard_component.css'],
        templateUrl: 'dashboard_component.html',
        directives: [coreDirectives])
    class DashboardComponent implements OnInit{
    @ViewChild('portfolioPie')
      DivElement pieDiv;
      var data = DataTable([
        ['BTC','1'],
        ['ETH', '1'],
        ['ICX','1']
        ]);
    
      @override
      void ngOnInit() {
        var container = pieDiv;
        var table = DataTable([
          ['Categories', 'Long series name', 'Series 2', 'Series 3'],
          ['January', 1, 3, 5],
          ['February', 3, 4, 6],
          ['March', 4, 3, 1],
          ['April', null, 5, 1],
          ['May', 3, 4, 2],
          ['June', 5, 10, 4],
          ['July', 4, 12, 8],
          ['August', 1, 3, 5],
          ['September', 3, 4, 6],
          ['October', 4, 3, 1],
          ['November', null, 5, 1],
          ['December', 3, 4, 2],
        ]);
    
        var options = {
          'animation': {
            'onEnd': () {
            }
          },
          'series': {
            'labels': {'enabled': true}
          },
          'xAxis': {
            'crosshair': {'enabled': true},
            'labels': {'maxRotation': 90, 'minRotation': 0}
          },
          'yAxis': {'maxValue': 30, 'minInterval': 5},
          'title': {'text': 'Bar Chart Demo'},
          'tooltip': {'valueFormatter': (value) => '$value units'}
        };
    
        var chart = BarChart(container);
        chart.draw(table, options);
    
    
      }
    
    }
    
    <h3>Dashboard</h3>
    <section>
        <div class="panel">
            <div class="panel-body">
                <h3 class="card-title">Portfolio</h3>
                <div id="portfolioPie" #portfolioPie></div>
            </div>
        </div>
    </section>
    
    #portfolioPie{
        height:400px;
        max-width: 100%;
    }
    
    opened by adewaleafolabi 4
  • Chart.draw()'s options parameter is not optional

    Chart.draw()'s options parameter is not optional

    Although the function signature lists the options map as an optional parameter, if it is not passed, no defaults are substituted and mergeMap errors out.

    Invocation: chart.draw(chartData);

    Stacktrace:

    EXCEPTION: NullError: invalid member on null: 'forEach'
    STACKTRACE: 
    package:modern_charts/src/utils.dart 156:6                               mergeMap
    package:modern_charts/src/base.dart 873:25                               draw
    
    opened by zmeggyesi 1
  • Problem with legend position

    Problem with legend position

    It's seems to have a problem with the label position. When the value is "none" it breaks the lib

        var chart = new LineChart(container);
    
        var options = {
    
    
        'legend': {
            'position': 'none'
        },
        'series': {
                'labels': {
                    'enabled': false
                }
            }
        };
    
        chart.draw(table, options);
    
    opened by BenNG 1
  • Version 0.1.18 not compatible with any publicly available version of Angular

    Version 0.1.18 not compatible with any publicly available version of Angular

    Version 0.1.18 fixes important bugs, but it requires Intl version 0.16.0. Intl version 0.16.0 is not compatible with any publicly available version of Angular. Even Angular 6.0.0-alpha+1 (the latest as of this time) requires Intl < 0.16.0.

    Version solving for an Angular project including modern_charts 0.1.18 results in something like the following.

    Pubspec Snippet:

    dependencies:
      angular: ^6.0.0-alpha+1
      modern_charts: ^0.1.18
      intl:
    

    pub get:

    Resolving dependencies...
    Because modern_charts >=0.1.18 depends on intl ^0.16.0 and angular 6.0.0-alpha+1 depends on intl >=0.13.0 <0.16.0, modern_charts >=0.1.18 is incompatible with angular 6.0.0-alpha+1.
    And because no versions of angular match >6.0.0-alpha+1 <7.0.0, modern_charts >=0.1.18 is incompatible with angular ^6.0.0-alpha+1.
    So, because test_project depends on both angular ^6.0.0-alpha+1 and modern_charts ^0.1.18, version solving failed.
    

    The easiest solution appears to be making the modern_charts Intl version requirement more lenient. The Intl 0.16.0 release appears to have few changes compared with previous so hopefully they wound not impact the functionality of modern_charts.

    opened by morrica 0
  • BarChart fails with single data point

    BarChart fails with single data point

    BarChart fails to draw any bars when there is only one data point and crashes when you mouseover the chart with an index out of range error.

    Take the following DataTable as an example for a website visitor count chart.

    DataTable table = DataTable([
        ['Categories', 'Visitors'],
        ['2019-09-07', 23],
      ]);
    

    Creating a BarChart with that table will not draw the single bar that it should and mousing over will result in an error that looks something like the following:

    EXCEPTION: RangeError (index): Index out of range: index must not be negative: -1
    STACKTRACE: 
    dart:sdk_internal                                                                             _get]
    package:modern_charts/packages/modern_charts/src/base.dart 1362:26                            [_getEntityGroupIndex]
    package:modern_charts/packages/modern_charts/src/base.dart 719:17                             [_mouseMove]
    package:stack_trace                                                                           <fn>
    package:angular/src/core/change_detection/packages/angular/src/core/zone/ng_zone.dart 144:18  <fn>
    dart:sdk_internal                                                                             runUnary
    package:angular/src/core/change_detection/packages/angular/src/core/zone/ng_zone.dart 141:18  [_runUnary]
    
    dart:sdk_internal                                                                                                                              listen
    package:modern_charts/packages/modern_charts/src/base.dart 755:43                                                                              [_initializeTooltip]
    package:modern_charts/packages/modern_charts/src/base.dart 891:5                                                                               draw
    
    opened by morrica 0
Owner
Man Hoang
Man Hoang
A flutter package which makes it easier to plot different types of charts with lots of customization, made purely in dart

multi_charts It is a library that provides different types of charts to plot data points. Currently it supports only Radar Chart, but will support mor

Intkhab Ahmed 28 Nov 9, 2022
:bar_chart: [wip] Create beautiful, responsive, animated charts using a simple and intuitive API.

fcharts A work-in-progress chart library for Flutter. Until version 1.0.0 the API is subject to change drastically. Needless to say, fcharts is not pr

Keenan Thompson 323 Dec 21, 2022
Charts Library for Flutter, written in Dart with Flutter.

Table of Contents New in the current release Illustration of the new "iterative auto layout" feature Autolayout step 1 Autolayout step 2 Autolayout st

Milan Zimmermann 225 Dec 25, 2022
Animated radial and pie charts for Flutter

Flutter Circular Chart A library for creating animated circular chart widgets with Flutter, inspired by Zero to One with Flutter. Overview Create easi

Victor Choueiri 387 Dec 26, 2022
Beautiful sparkline charts for Flutter

flutter_sparkline Beautiful sparkline charts for Flutter. Installation Install the latest version from pub. Quick Start Import the package, create a S

Victor Choueiri 255 Dec 21, 2022
Elegant OHLC Candlestick and Trade Volume charts for @Flutter

flutter_candlesticks Elegant OHLC Candlestick and Trade Volume charts for Flutter Usage Install for Flutter with pub. Property Description data Requir

Trent Piercy 402 Dec 21, 2022
A library to draw fantastic bar charts race in Flutter

bar_chart_race The first library to draw fantastic bar charts race in Flutter Usage Let's get started add the dependencies to your app: dependencies:

Mimene Younes 6 Jun 24, 2022
Flutter chart library contains depth charts supporting various indicators and zooming

flutter_k_chart 介绍 一个仿火币的flutter图表库包含深度图,支持各种指标及放大缩小、平移等操作 webdemo演示 Demo v0.1.0:下载 APK 演示 简单用例 1.在 pubspec.yaml 中添加依赖 本项目数据来自火币openApi,火币的接口可能需要翻墙,接口

gwh 259 Dec 30, 2022
Flutter Cryptocurrency Charts application based on Clean Architecture.

About the project The purpose of this project is to develop the best Cryptocurrency, markets data and charts experience. This project has been built u

null 25 Jan 1, 2023
Charts [2148⭐] - By Google Team.

Charts is a general charting library, currently enabled for the Flutter mobile UI framework. See the online gallery for supported chart types and exam

Google 2.8k Dec 31, 2022
In this project you will see how to generate charts with the data from the Firestore.

FlutterChartFirestore Flutter Tutorial - Flutter Charts+Firestore Video series can be watched here https://youtu.be/HGkbPrTSndM Getting Started In thi

Whatsupcoders 49 Oct 21, 2022
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Dec 28, 2022
kg_charts icon library. At present, there are only radar charts

kg_charts icon library. At present, there are only radar charts. Other types of charts may be added later

zhonghua 10 Oct 25, 2022
A pretty plotting package for Flutter apps

flutter_plot R. C. Howell - 2018 A pretty plotting package for Flutter apps. Sizing and autopadding isn't great right now, but tinkering with padding

R. C. Howell 47 Sep 27, 2022
Animating Location Pin Flutter Package

Animating Location Pin This Flutter package provides a Animating Location Pin Widget which can be used while fetching device location. ?? Installation

Ayush P Gupta 13 Jun 15, 2021
Sliver bar chart - A package that supports Bar Chart in a Flutter Sliver

Sliver bar chart - A package that supports Bar Chart in a Flutter Sliver. This Package allows us to add Bar Chart in Sliver and sets a Bar Chart as a Header on Slivers Scroll.

MindInventory 19 Oct 11, 2022
A simple radial chart for Flutter

A simple radial chart for Flutter

null 2 Jun 2, 2022
A simple app to track your financial life using flutter

Budget Budy Budget Budy is the easiest and most user friendly expense manager app. The simple fact is, by tracking your spending you will be able to s

MUFADDAL SHAKIR 20 Jan 2, 2023
A simple candlestick chart for flutter. Supports smooth scroll and zoom

simple_candlestick_chart A simple candlestick chart for flutter. Supports smooth

7c00 14 Oct 17, 2022