1 回答

TA貢獻(xiàn)1785條經(jīng)驗(yàn) 獲得超8個(gè)贊
發(fā)布答案,以便它可以幫助像我這樣的人。我能夠找到這個(gè)博客幫助我的答案。正如他們所提到的,我需要在 Xaml 中添加數(shù)據(jù)上下文。
LiveChart:CartesianChart Grid.Row="1" Background="White" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:LiveChartControl}}">
<LiveChart:CartesianChart.AxisX>
<LiveChart:Axis Title="{Binding Path=XAxisTitle, Mode=TwoWay}" Labels="{Binding Path=XAxisValues, Mode=TwoWay}" MinValue="0"/>
</LiveChart:CartesianChart.AxisX>
<LiveChart:CartesianChart.AxisY>
<LiveChart:Axis Title="{Binding Path=YAxisTitle, Mode=TwoWay}" LabelFormatter="{Binding Path=Formatter, Mode=TwoWay}" MinValue="0"></LiveChart:Axis>
</LiveChart:CartesianChart.AxisY>
<LiveChart:CartesianChart.Series>
<LiveChart:LineSeries Values="{Binding Path=ChartPointsInChartValues, Mode=TwoWay}"/>
<LiveChart:VerticalLineSeries Values="{Binding Path=EnergyLineChartValues , Mode=TwoWay}"/>
</LiveChart:CartesianChart.Series>
</LiveChart:CartesianChart>
這現(xiàn)在開始起作用了。
- 1 回答
- 0 關(guān)注
- 274 瀏覽
添加回答
舉報(bào)