搜尋套件、儲存庫與 APP 分類

flutter_vertical_heatmap 封面
套件詳情v1.0.3

flutter_vertical_heatmap

適用於 Flutter 的垂直熱力圖圖表套件,提供精緻設計的使用者介面與極致的彈性!

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
34
喜歡數
32
Pub 分數
160

安裝套件

flutter pub add flutter_vertical_heatmap

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個用於建立垂直熱力圖圖表的 Flutter 套件,具備簡潔且可自訂的使用者介面。它為時間序列或分類資料提供彈性的資料視覺化功能,支援跨多個平台的順暢渲染。專為尋求以垂直格式優雅呈現密集資料模式的開發者設計,提供響應式版面與直覺的設定選項。適合儀表板、分析與監控應用。

適用情境

  • 顯示時間序列資料
  • 按小時可視化使用者活動
  • 監控系統性能
  • 分析每日趨勢
  • 建立互動式儀表板
  • 追蹤事件頻率

主要特色

  • 熱圖的垂直方向
  • 高度可自訂的色彩方案
  • 響應式且可擴展的設計
  • 支援多個平台
  • 流暢的動畫和過渡
  • 與現有 Flutter 應用的輕鬆整合

適合對象

  • 數據分析師
  • 儀表板開發者
  • UI/UX 設計師
  • 監控應用程式創建者
  • 教育類應用開發者

使用建議

  • 需要仔細的資料格式化
  • 在非常大的資料集上可能會影響效能
  • 有限的內建互動功能
  • 需要在所有目標平台進行測試
  • 自定樣式可能需要額外的程式碼

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Vertical Heatmap

🐙 A vertical heatmap chart package for Flutter, offering beautifully crafted UI with ultimate flexibility!

heatmap

Getting started

Depend on it.
flutter pub add flutter_vertical_heatmap

or

Add below line to your personal package's pubspec.yaml.

dependencies:
  flutter_vertical_heatmap: ^1.0.3

And run flutter pub get to install.

Import it.
import 'package:flutter_vertical_heatmap/flutter_vertical_heatmap.dart';

Usage

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  late Map<DateTime, int> datasets = {};

  @override
  void initState() {
    super.initState();
    var now = DateTime.now();
    datasets[DateTime(now.year, now.month, now.day)] = 1;
    datasets[DateTime(now.year, now.month, now.day - 1)] = 2;
    datasets[DateTime(now.year, now.month, now.day - 2)] = 3;
    datasets[DateTime(now.year, now.month, now.day - 3)] = 4;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Flutter Vertical Heatmap'),
      ),
      body: SingleChildScrollView(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const SizedBox(height: 80),
              HeatMap(
                startDate: HeatMapUtils.oneYearBefore(DateTime.now()),
                endDate: DateTime.now(),
                monthLabel: HeatMapDefault.monthLabel,
                weekLabel: HeatMapDefault.weekLabel,
                datasets: datasets,
                size: 32,
                // If you do not want to use a color tip, leave colorTipSize blank or pass null.
                colorTipSize: 20, 
                margin: const EdgeInsets.all(3),
                colorsets: {
                  1: Colors.green.shade100,
                  3: Colors.green.shade300,
                  5: Colors.green.shade500,
                  7: Colors.green.shade700,
                },
                colorTipLabel: const ["0~3", "3~5", "5~7", "7+"],
                onClick: (value) {
                  setState(() {
                    datasets[value] =
                        datasets[value] != null ? datasets[value]! + 1 : 1;
                  });
                  ScaffoldMessenger.of(context).clearSnackBars();
                  ScaffoldMessenger.of(context)
                      .showSnackBar(SnackBar(content: Text(value.toString())));
                },
              ),
              const SizedBox(height: 80),
            ],
          ),
        ),
      ),
    );
  }
}

License

MIT License

Copyright (c) 2024 Lee Chang Woo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。