有没有办法使用 syncfusion flutter 向 hilo 图表添加标记?
Is there a way to add markers to a hilo chart with syncfusion flutter?
我想在 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 条的顶部和底部添加 "dot" 标记?
试图在这里帮助你,但你的权利不起作用,但我不认为你做错了什么文档非常简单,我把它放在空项目中,所以没有干扰。我也让它与图像一起工作。如果你真的需要它,你可以找到一张你想要的图片作为解决方法。很抱歉不能提供更多帮助。
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)],
)
还有一件事让我觉得这不是你做错了什么,如果你打开工具提示然后点击栏它知道你选择了哪个图标如果你有什么问题我怀疑它会
截至目前,我们还没有对金融系列的标记支持,我们将在即将发布的 vol 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
),
截图
参考样本如下。
我想在 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 条的顶部和底部添加 "dot" 标记?
试图在这里帮助你,但你的权利不起作用,但我不认为你做错了什么文档非常简单,我把它放在空项目中,所以没有干扰。我也让它与图像一起工作。如果你真的需要它,你可以找到一张你想要的图片作为解决方法。很抱歉不能提供更多帮助。
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)],
)
还有一件事让我觉得这不是你做错了什么,如果你打开工具提示然后点击栏它知道你选择了哪个图标如果你有什么问题我怀疑它会
截至目前,我们还没有对金融系列的标记支持,我们将在即将发布的 vol 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
),
截图
参考样本如下。