搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。