Telerik Chart - Общая вертикальная ось создает «Элемент уже является потомком другого элемента» - PullRequest
0 голосов
/ 09 апреля 2019

Простое приложение UWP с диаграммой Telerik:

xmlns:tc="using:Telerik.UI.Xaml.Controls.Chart"
xmlns:tc1="using:Telerik.Charting"


<tc:RadCartesianChart >
 <tc:RadCartesianChart.Resources>
  <tc:LinearAxis x:Key="additionalVerticalAxis" HorizontalLocation="Right" />
 </tc:RadCartesianChart.Resources>

<tc:RadCartesianChart.HorizontalAxis>
    <tc:CategoricalAxis />
</tc:RadCartesianChart.HorizontalAxis>

<tc:RadCartesianChart.VerticalAxis>
    <tc:LinearAxis Maximum="100" Foreground="Magenta" />
</tc:RadCartesianChart.VerticalAxis>

<tc:RadCartesianChart.Series>
    <tc:BarSeries VerticalAxis="{StaticResource additionalVerticalAxis}">
        <tc:BarSeries.DataPoints>
            <tc1:CategoricalDataPoint Value="50"/>
            <tc1:CategoricalDataPoint Value="20"/>
            <tc1:CategoricalDataPoint Value="60"/>
        </tc:BarSeries.DataPoints>
    </tc:BarSeries>
    <tc:BarSeries VerticalAxis="{StaticResource additionalVerticalAxis}">
        <tc:BarSeries.DataPoints>
            <tc1:CategoricalDataPoint Value="34"/>
            <tc1:CategoricalDataPoint Value="28"/>
            <tc1:CategoricalDataPoint Value="54"/>
        </tc:BarSeries.DataPoints>
    </tc:BarSeries>
    <tc:LineSeries StrokeThickness="2" Stroke="Magenta">
        <tc:LineSeries.DataPoints>
            <tc1:CategoricalDataPoint Value="40"/>
            <tc1:CategoricalDataPoint Value="30"/>
            <tc1:CategoricalDataPoint Value="50"/>
        </tc:LineSeries.DataPoints>
    </tc:LineSeries>
</tc:RadCartesianChart.Series>
</tc:RadCartesianChart>

Это образец из официальных (WPF) документов (часть "Общая вертикальная ось").Сбой приложения во время выполнения с ошибкой:

{Windows.UI.Xaml.UnhandledExceptionEventArgs}
Exception: {System.Exception: No installed components were detected.

Element is already the child of another element.
at System.Runtime.InteropServices.WindowsRuntime.IVector`1.Append(T value)
at System.Runtime.InteropServices.WindowsRuntime.VectorToCollectionAdapter.Add[T](T item)
at Telerik.UI.Xaml.Controls.Chart.RadChartBase.OnPresenterAdded(ChartElementPresenter presenter)
at Telerik.UI.Xaml.Controls.Chart.CartesianSeries.OnAttached()
at Telerik.UI.Xaml.Controls.Chart.ChartElementPresenter.Attach(RadChartBase chartBase)
at Telerik.UI.Xaml.Controls.Chart.RadChartBase.ApplyTemplateCore()
at Telerik.UI.Xaml.Controls.RadControl.OnApplyTemplate()
at Windows.ApplicationModel.Core.UnhandledError.Propagate()

...

Что здесь не так?Как я могу разделить оси между несколькими сериями?

...