【问题标题】:Is there a way to add markers to a hilo chart with syncfusion flutter?有没有办法使用同步融合颤振将标记添加到希洛图表?
【发布时间】:2020-04-09 23:51:41
【问题描述】:

我想在 SyncFusion 中创建一个 HiLo 图表(使用 this Flutter plugin),如下所示:

我可以制作一个 hilo 图表 - 但我似乎无法让那些白点出现 - 我希望 markerSettings 属性可以做到这一点,但它没有。

HiloSeries<Stonk, DateTime>(
    markerSettings: MarkerSettings(
      isVisible: true,
      color: Colors.white,
    ),
    color: Colors.green,
    borderWidth: 10,
    xValueMapper: (Stonk stonk, _) => stonk.time,
    highValueMapper: (Stonk stonk, _) => stonk.high,
    lowValueMapper: (Stonk stonk, _) => stonk.low,
    dataSource: stonks,
  );

这是我尝试过的,但添加 markerSettings 属性不会使那些白点出现。

有没有办法在 hilo 条的顶部和底部添加“点”标记?

【问题讨论】:

    标签: flutter syncfusion


    【解决方案1】:

    截至目前,我们没有对金融系列的标记支持,我们将在即将发布的第 1 卷 SP1 版本中为 hilo 系列提供标记支持。但是,您可以使用范围列系列来满足您的要求。在这里,您可以启用可以添加到条形顶部和底部的标记。实现此场景的代码如下。

    // Series configurations
     RangeColumnSeries<ChartData, double>(
        dataSource: chartData,
        markerSettings: MarkerSettings(isVisible: true),
        xValueMapper: (ChartData sales, _) => sales.x,
        highValueMapper: (ChartData sales, _) => sales.high,
        lowValueMapper: (ChartData sales, _) => sales.low,
        // Other configurations
      ),
    

    截图

    参考示例如下。

    Range column sample

    【讨论】:

    • 理解我的回答中出现了错误,这是一个非常不错的应用程序,感谢您的澄清
    【解决方案2】:

    试图在这里帮助你,但你的权利它不起作用,但我不认为这是你做错事的事情,文档非常简单,我把它放在空项目中,所以没有干扰。我也让它与图像一起工作。如果你真的需要它,你可以找到一张你想要的图片作为解决方法。抱歉,无法提供更多帮助。

    HiloSeries<Offset, DateTime>(
                    enableTooltip: true,
                    markerSettings: MarkerSettings(
                        borderWidth: 8,
                        width: 10,
                        shape: DataMarkerType.image,
                        borderColor: Colors.black,
                        isVisible: true,
                        color: Colors.black,
                        height: 10,
                        image: Image.asset('assets/images/logo.png').image),
                    color: Colors.green,
                    borderWidth: 2,
                    xValueMapper: (Offset stonk, _) => DateTime(stonk.dx.toInt()),
                    highValueMapper: (Offset stonk, _) => stonk.dx,
                    lowValueMapper: (Offset stonk, _) => stonk.dy,
                    dataSource: [Offset(1, 2), Offset(2, 1), Offset(3, 4)],
                  )
    

    还有一件事让我觉得如果你打开工具提示然后点击栏它知道你选择了哪个图标如果你有什么问题我怀疑它不会是你做错的事

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-20
      相关资源
      最近更新 更多