如何使用 Xamarin 中的 Syncfusion 自定义工具提示的内容和位置?

How do I customize the content and location of a tooltip using Syncfusion in Xamarin?

我在 Visual Studio 2017 年使用 Syncfusion for Xamarin 在 XAML 中设置了堆叠柱形图。我尝试根据示例 here 添加自定义文本,但是当工具提示被激活时,我 运行 进入异常。这是我正在使用的代码:

<chart:SfChart.Series>

<chart:StackingColumnSeries EnableTooltip="True"
  Width="0.5"
  ItemsSource="{Binding TankLevels}" 
  XBindingPath="Name" YBindingPath="Level1">
        <chart:StackingColumnSeries.TooltipTemplate>
            <DataTemplate>
                <StackLayout>
                    <Label Text="test"></Label>
                </StackLayout>
            </DataTemplate>
        </chart:StackingColumnSeries.TooltipTemplate>

  <chart:BarSeries.ColorModel>
    <chart:ChartColorModel Palette="Custom" CustomBrushes="{Binding WaterColor}">         
    </chart:ChartColorModel>
  </chart:BarSeries.ColorModel>

</chart:StackingColumnSeries>

我已经分析了你的代码片段并根据它准备了一个样本,样本可以从下面的 link 下载。

样本:215585

恐怕我无法重现所报告的问题,它工作正常。您能否提供更多信息,例如异常的堆栈跟踪?

谢谢, 迈克尔

注意:我为 Syncfusion 工作

问题是我使用的是 Syncfusion 的 Xamarin Controls 的过时版本。更新到最新版本后,我没有再遇到任何问题。