搜索插件、代码仓与 APP 分类

插件详情v3.0.2

chart_engine

可互换图表引擎(如 ChartJS 和 ApexCharts)的图表生成器。

Web
近 30 天下载
2320
喜欢数
50
Pub 分数
160

安装插件

flutter pub add chart_engine

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Chart Engine 是一个 Flutter/Dart 包,提供统一的接口以使用可互换的后端引擎(如 ChartJS 和 ApexCharts)生成图表。该包主要针对 Web 应用程序设计,允许开发者在不更改图表配置代码的情况下无缝切换渲染引擎。这种抽象简化了与不同可视化库的集成,同时在各个平台上保持一致的 API 使用方式。该包支持动态图表更新和响应式设计,非常适合数据密集型 Web 仪表板。

适合场景

  • 基于 Web 的数据仪表板
  • 交互式图表显示
  • 动态数据可视化
  • 跨引擎图表兼容性
  • 实时分析界面

主要特点

  • 即插即用的图表引擎
  • 支持 ChartJS 和 ApexCharts
  • 响应式图表渲染
  • 引擎间的 API 保持一致
  • 与网页应用轻松集成

适合对象

  • Flutter web 开发人员
  • 数据可视化项目
  • 需要多种图表类型的仪表板
  • 团队在图表库之间切换
  • 需要灵活图表后端的应用程序

使用建议

  • 主要针对网络优化
  • 有限的原生移动支持
  • 特定于引擎的功能可能未完全暴露
  • 需要理解底层图表库
  • 依赖于在网页上下文中加载的外部引擎脚本

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

chart_engine

pub package Null Safety Dart CI GitHub Tag New Commits Last Commits Pull Requests Code size License Live Example

Chart generator with interchangeable chart engines, like ChartJS and ApexCharts.

Engines

NOTE: You don't need to read any specific documentation of any engine to use chart_engine, since any Chart configuration needed to generate your Chart will be automatically handled by this package (see the example).

Usage

A simple example using ApexCharts (ChartsJS is commented):

import 'dart:html';

//import 'package:chart_engine/chart_engine_chartjs.dart';
import 'package:chart_engine/chart_engine_apexcharts.dart';

void main() async {

  var series = ChartSeries(
      ['Jan','Feb','Mar'],
      {
        'A': [10,20,5] ,
        'B': [15,25,55] ,
        'C': [100,130,140]
      }
  ) ;

  series.title = 'Chart Example' ;
  series.xTitle = 'Months' ;
  series.yTitle = 'Count' ;
  series.options.fillLines = true ;
  series.options.straightLines = true ;

  //var charEngine = ChartEngineChartJS() ;
  var charEngine = ChartEngineApexCharts() ;
  await charEngine.load() ;
  charEngine.renderLineChart( querySelector('#output') , series ) ;


}

Live Example

You can see here a live example

If your prefer you can experiment with the example from the source code.

Example from Sources

Get the source

  $> git clone https://github.com/Colossus-Services/chart_engine.git

...and see the Web Example (just follow the README file for instructions).

Loading Engines JavaScript Libraries

This Dart package already bundles the JavaScript libraries of each supported engine. When an implementation of ChartEngine is instantiated, the corresponding JavaScript library is automatically loaded and no extra code is needed in your Dart files or HTML files.

The loading processes is made by the package amdjs.dart. It loads the JavaScript libraries using AMD framework when an AMD implementation is present and detected, or injecting a tag <script src='lib-x.js'></script> as fallback.

ChartJS and Moment

You don't need to load Moment JS library to use Time Series Charts when using ChartJS engine. We implement a fallback Date adapter, using Dart code interoperability, based in Dart DateTime and DateFormat implementations. ;-P

Features and bugs

Please file feature requests and bugs at the issue tracker.

Colossus.Services

This is an open-source project from Colossus.Services: the gateway for smooth solutions.

Author

Graciliano M. Passos: gmpassos@GitHub.

License

Apache License - Version 2.0

所属分类

依赖

依赖清单 6 项

  • amdjs^3.0.0
  • color_palette_generator^2.0.1
  • dom_tools^3.1.1
  • intl^0.20.3
  • swiss_knife^3.4.2
  • web_utils^1.1.0

源码仓库

使用此插件的项目

暂无相关数据。