multi_charts 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

Build Status pub package

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 more types in the coming future.

Radar Chart #

A chart which plots the values in the form of a spider web or radar. It takes the @required values parameter which provides the data points and @required maxValue which defines the scale of the graph. E.g. The chart contains five levels, if maxValue=10, then each level will have the value '2'.

The other parameters are optional which define different behaviours for the chart like:

  • labels - which will be shown in the graph, if not provided, will default to the value of data points. If provided, it's length should be same as that of values

  • size - which defines the canvas area defaults to Size.infinite and is constrained by the parent widget.

  • fillColor - defines the background color of the plotted graph, if not provided, defaults to Colors.black26.

  • strokeColor - defines the color of the chart outlines, defaults to Colors.black87.

  • labelColor - defines the color of the chart labels, defaults to Colors.white.

  • maxHeight and maxWidth - defines the maximum width and height of the chart when no parent constraints are applied, otherwise ignored.

  • textScaleFactor - defines the factor by which the label's textSize should increase, if not provided defaults to 0.04

  • labelWidth - defines the maximum width of the labels, if not provided, defaults to internally calculated values based on the size of the chart.

  • maxLinesForLabels - defines the maximum lines for the label's text, if not provided, defaults to the hundredth part of the container height of the parent container. E.g.if height of the parent is 200, the maxLinesForLabels=2

  • animate - defines the animation toggle, if true, the chart will animate, else not. Defaults to true.

  • animationDuration - defines the duration of the animation for the graph. If not provided, defaults to 1500 milliseconds.

  • curve - defines the animation's progress in a non-linear fashion.

Screenshot #

Radar Chart Red Radar Chart Blue

[0.0.1] - 01/09/2019.

  • Initial release - Supports Radar Chart with lots of customizations.

[0.0.2] - 01/09/2019

  • Fixed screenshots

[0.1.0] - 21/09/2019

  • Added labelColor parameter to give the desired color to labels, default value is Colors.white.
  • Added a check for values (Minimum 3 values are required for plotting Radar Chart), else it will throw ArgumentError.
  • Added a check for length of values and labels, both should be same.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:multi_charts/multi_charts.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Radar Chart Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text("Radar Chart Example"),
        ),
        body: Center(
          child: Container(
            width: 450,
            height: 450,
            child: RadarChart(
              values: [1, 2, 4, 7, 9, 0, 6],
              labels: [
                "Label1",
                "Label2",
                "Label3",
                "Label4",
                "Label5",
                "Label6",
                "Label7",
              ],
              maxValue: 10,
              fillColor: Colors.blue,
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  multi_charts: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


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

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test