パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.0

flutter_sparkline

Flutter用の美しいスパークラインチャート。

30日間ダウンロード
426
いいね数
72
Pub ポイント
30

パッケージをインストール

flutter pub add flutter_sparkline

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter Sparkline は、Flutter アプリケーションでコンパクトで視覚的に魅力的なスパークラインチャートをレンダリングするための軽量パッケージです。開発者がテキストやUI要素内に小さなシンプルな折れ線グラフを直接表示できるようにし、限られたスペースで時間経過に伴うトレンドを示すのに最適です。カスタマイズ可能な色、線幅、データポイントのスタイルをサポートしており、ダッシュボード、レポート、分析インターフェースに適しています。クリーンなAPIと効率的なパフォーマンスにより、既存のFlutterプロジェクトにスムーズに統合できます。

用途

  • ダッシュボードでトレンドデータを表示する
  • テーブル内のメトリクスの可視化
  • アプリ分析UIの向上
  • コンパクト形式で履歴データを表示
  • リスト項目にマイクロチャートを統合する

主な機能

  • ミニマリスティックで高インパクトな可視化
  • カスタマイズ可能な線の色と太さ
  • スムーズなカーブレンダリング
  • 動的データの更新をサポート
  • 軽量で高速なパフォーマンス

適している対象

  • 制約された空間におけるデータの可視化
  • モバイルアプリ分析
  • リアルタイムメトリクス表示
  • 微細なトレンドインジケーターを必要とするUI
  • 複雑さなしにシンプルなチャートを求める開発者

注意事項

  • 行ベースのスパークラインのみに制限
  • ツールチップのようなインタラクティブ機能なし
  • 大規模なデータセットには適していません
  • データスケーリングの手動処理が必要
  • 小さな離散データシリーズと併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

pub package

flutter_sparkline

Beautiful sparkline charts for Flutter.

screenshot

Installation

Install the latest version from pub.

Quick Start

Import the package, create a Sparkline, and pass it your data.

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

void main() {
  var data = [0.0, 1.0, 1.5, 2.0, 0.0, 0.0, -0.5, -1.0, -0.5, 0.0, 0.0];
  runApp(
    new MaterialApp(
      home: new Scaffold(
        body: new Center(
          child: new Container(
            width: 300.0,
            height: 100.0,
            child: new Sparkline(
              data: data,
            ),
          ),
        ),
      ),
    ),
  );
}

base example screenshot

Customization

Sparkline
Property Default
lineWidth 2.0
lineColor Colors.lightBlue
lineGradient null

Example:

new Sparkline(
  data: data,
  lineWidth: 5.0,
  lineColor: Colors.purple,
);

lineopts example screenshot

new Sparkline(
  data: data,
  lineWidth: 10.0,
  lineGradient: new LinearGradient(
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
    colors: [Colors.purple[800], Colors.purple[200]],
  ),
);

lineopts example screenshot


Points
Property Default
pointsMode PointsMode.none
pointSize 4.0
pointColor Colors.lightBlue[800]
PointsMode Description
none (default) Do not draw individual points.
all Draw all the points in the data set.
last Draw only the last point in the data set.

Example:

new Sparkline(
  data: data,
  pointsMode: PointsMode.all,
  pointSize: 8.0,
  pointColor: Colors.amber,
);

all points example screenshot

new Sparkline(
  data: data,
  pointsMode: PointsMode.last,
  pointSize: 8.0,
  pointColor: Colors.amber,
);

last point example screenshot


Fill
Property Default
fillMode FillMode.none
fillColor Colors.lightBlue[200]
fillGradient null
FillMode Description
none (default) Do not fill, draw only the sparkline.
above Fill the area above the sparkline.
below Fill the area below the sparkline.

Example:

new Sparkline(
  data: data,
  fillMode: FillMode.below,
  fillColor: Colors.red[200],
);

fill below example screenshot

new Sparkline(
  data: data,
  fillMode: FillMode.above,
  fillColor: Colors.red[200],
);

fill above example screenshot

new Sparkline(
  data: data,
  fillMode: FillMode.below,
  fillGradient: new LinearGradient(
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
    colors: [Colors.red[800], Colors.red[200]],
  ),
);

fill above example screenshot


Todo:
  • [x] simple sparkline
  • [x] custom line width
  • [x] custom line color
  • [x] optional rounded corners
  • [x] fill
  • [x] embiggen individual points/change color
  • [x] different points modes [all/last/none]
  • [ ] animate between two sparklines
  • [ ] animate drawing a single sparkline
  • [ ] gesture detector to select closest point to tap
  • [ ] baseline
  • [x] different fill modes [above/below/none]
  • [x] fix edge points overflowing by offsetting by lineWidth
  • [ ] better corner rounding
  • [ ] axis labels
  • [x] gradient shader on line paint
  • [x] gradient shader on fill paint
  • [ ] multiple overlapping sparklines on a shared axis
  • [ ] tests

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。