flexi_kline_draw_tools 2.0.0 copy "flexi_kline_draw_tools: ^2.0.0" to clipboard
flexi_kline_draw_tools: ^2.0.0 copied to clipboard

draw tools library for FlexiKline

flexi_kline_draw_tools #

flexi_kline 的绘图工具扩展包,提供趋势线、斐波那契、平行通道等 19 种绘图工具。

版本兼容 #

flexi_kline_draw_tools flexi_kline Flutter
2.0.0 ^2.5.1 >=3.27.0

版本号 major 与 flexi_kline 对齐,之后独立演进。

安装 #

dependencies:
  flexi_kline_draw_tools: ^2.0.0

快速上手 #

两种方式注册绘图工具(二选一):

// 方式一:函数调用
registerAllDrawObjectBuilder(controller);

// 方式二:混入配置类
class MyConfig extends FlexiKlineStorage
    with FlexiKlineConfigurationMixin, DrawObjectBuildersConfigMixin {
  // drawObjectBuilders 已自动提供
}

支持的绘图工具 #

分组 工具 点数
Lines trendLine, arrowLine, extendedTrendLine, trendAngle, rayLine, horizontalTrendLine, horizontalRayLine 2
Lines horizontalLine, verticalLine, crossLine, priceLine 1
Projection rectangle 2
Projection parallelChannel, parallelogram 3
Fibonacci fibRetracement, fibFans 2
Fibonacci fibExpansion 3
Patterns tripleWaves 4
Patterns pentaWaves 6

tripleWavespentaWaves 都由 ElliottImpulseWaveDrawObject 实现,区别仅在点数。

参数定制 #

通过 DrawToolsConfig.configure() 统一配置,只传入需要修改的参数:

DrawToolsConfig.configure(
  arrowLine: const ArrowLineDrawParam(arrowsLen: 20),
  rectangle: const RectangleDrawParam(rectangleBgOpacity: 0.2),
  priceLine: const PriceLineDrawParam(
    priceText: TextAreaConfig(
      style: TextStyle(color: Color(0xFFFF0000), fontSize: 11),
    ),
  ),
);

各工具的参数类:

工具 参数类 主要字段
ArrowLine ArrowLineDrawParam arrowsRadians, arrowsLen
PriceLine PriceLineDrawParam priceText, priceTextMargin
TrendAngle TrendAngleDrawParam angleBaseLineMinLen, angleRadSize, angleText
ParallelChannel ParallelChannelDrawParam parallelBgOpacity
Rectangle RectangleDrawParam rectangleBgOpacity
Parallelogram ParallelogramDrawParam bgOpacity
FibExpansion FibonacciDrawParam fibRates, fibColors, fibBgOpacity, fibText
FibRetracement FibonacciDrawParam 同上(独立实例)
FibFans FibFansDrawParam fibFansParams, fibFansColors, fibFansGridColor, fibText

线色、线宽、虚线样式由核心包的 Overlay.line 控制,不在此配置。 priceTextangleText 默认为 null,回退到核心包 DrawConfig.ticksText 的主题色。

License #

Apache License 2.0

0
likes
140
points
80
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

draw tools library for FlexiKline

Topics

#chart #kline #draw-tools #flexi-kline

License

Apache-2.0 (license)

Dependencies

copy_with_extension, equatable, flexi_kline, flutter, json_annotation

More

Packages that depend on flexi_kline_draw_tools