dart_apex_charts 0.2.6

Dart Apexcharts #

A Dart API for APEXCHARTS using dart:js.

Usage #

To understand usage, see the example source code and the corresponding output.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

License #

ApexCharts is released under MIT license. You are free to use, modify and distribute this software, as long as the copyright header is left intact.

0.0.1 #

  • Initial version, created by Stagehand

0.2.0 #

  • Add example, some docs

0.2.1 #

  • Add strong mode analyser

0.2.6 #

  • Update vendor libs

example/dart_apex_charts_example.dart

import 'package:dart_apex_charts/dart_apex_charts.dart';

void main() {
  drawHorizontalBar();
  drawSimpleBar();
  drawSimplePie();
}

void drawHorizontalBar() {
  Map<String, dynamic> options = <String, dynamic>{
    'chart': {
      'type': 'bar',
    },
    'plotOptions': {
      'bar': {
        'horizontal': true,
      }
    },
    'dataLabels': {'enabled': false},
    'series': [
      {
        'data': [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380]
      }
    ],
    'xaxis': {
      'categories': [
        'South Korea',
        'Canada',
        'United Kingdom',
        'Netherlands',
        'Italy',
        'France',
        'Japan',
        'United States',
        'China',
        'Germany'
      ],
    },
    'yaxis': <String, dynamic>{},
    'tooltip': <String, dynamic>{}
  };
  ApexCharts chart = ApexCharts(
      '#horizontalBar', options);
  chart.render();
}

void drawSimpleBar() {
  Map<String, dynamic> options = <String, dynamic>{
    'chart': {
      'height': 380,
      'type': 'bar',
    },
    'plotOptions': {
      'bar': {
        'distributed': true,
      }
    },
    'series': [
      {
        'data': [400, 430, 448, 470, 540, 580, 690, 1100]
      }
    ],
    'xaxis': {
      'categories': [
        'South Korea',
        'Canada',
        'United Kingdom',
        'Netherlands',
        'Italy',
        'France',
        'Japan',
        'United States'
      ],
      'labels': {
        'style': {
          'colors': ['#008FFB', '#00E396', '#FEB019', '#FF4560', '#775DD0', '#546E7A', '#26a69a', '#D10CE8']
        }
      }
    },
  };
  ApexCharts chart = ApexCharts('#simpleBar', options);
  chart.render();
}

void drawSimplePie() {
  Map<String, dynamic> options = <String, dynamic>{
    'chart': {
      'type': 'pie',
    },
    'series': [400, 430, 448, 470, 540, 580, 690, 1100],
    'labels': [
      'South Korea',
      'Canada',
      'United Kingdom',
      'Netherlands',
      'Italy',
      'France',
      'Japan',
      'United States'
    ]
  };
  ApexCharts chart = ApexCharts('#simplePie', options);
  chart.render();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_apex_charts: ^0.2.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_apex_charts/dart_apex_charts.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
31
Learn more about scoring.

We analyzed this package on Jul 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms:

Low code quality prevents platform classification.

Health issues and suggestions

Fix lib/src/dart_apex_charts_interop.dart. (-99.87 points)

Analysis of lib/src/dart_apex_charts_interop.dart failed with 23 errors, including:

line 1 col 1: Undefined name 'JS' used as an annotation.

line 6 col 8: Target of URI doesn't exist: 'package:js/js.dart'.

line 9 col 1: Undefined name 'JS' used as an annotation.

line 16 col 1: Undefined name 'JS' used as an annotation.

line 17 col 1: Undefined name 'anonymous' used as an annotation.

Format lib/src/dart_apex_charts_base.dart.

Run dartfmt to format lib/src/dart_apex_charts_base.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
build_runner ^1.0.0
build_web_compilers ^0.4.0

Admin