LightningChartには3つのWPF APIがあります。結合可能/半結合可能および結合不可能。彼らの違いは何ですか?LightningChartでのデータバインディング
データポイントのコレクションをバインドして折れ線グラフを作成するにはどうすればよいですか?
LightningChartには3つのWPF APIがあります。結合可能/半結合可能および結合不可能。彼らの違いは何ですか?LightningChartでのデータバインディング
データポイントのコレクションをバインドして折れ線グラフを作成するにはどうすればよいですか?
バインド可能なチャートAPI:DependencyProperties、のObservableCollectionベースのリストやデータ入力。すべてを束縛してください。 XAMLで設定します。競合他社と比較して良好な性能を示しますが、半結合または非結合と同程度に良好ではありません。パフォーマンスの違いは、数百の一連のデータポイントと何百万ものデータポイントを使用している場合に特に顕著です。
セミバインド可能なチャートAPI:リストでDependencyProperties、ObservableCollections。データ入力は配列ベースであり、コードビハインドで行う必要があります。したがって、UI設定とチャートオブジェクトをバインドできますが、コード内のデータをフィードするだけです。非常に良いパフォーマンス。
バインド不可能なチャートAPI:No DependencyProperties、リストまたはデータ入力にObservableCollectionsがありません。コードビハインドでの通常のプロパティと使用法最高のパフォーマンスとマルチスレッド機能demo applicationが示すように、10億以上のポイントをリアルタイムモニタリングで監視することができます。バインド可能なチャートAPIで
あなたは、チャートを設定して、この
<Window x:Class="BindingExamplePointLineSeries.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lcub="http://schemas.arction.com/bindablecharting/ultimate/"
x:Name="thisTest"
Title="MainWindow" Height="350" Width="525">
<Grid>
<lcub:LightningChartUltimate>
<lcub:LightningChartUltimate.ViewXY>
<lcub:ViewXY>
<lcub:ViewXY.YAxes>
<lcub:AxisY/>
</lcub:ViewXY.YAxes>
<lcub:ViewXY.XAxes>
<lcub:AxisX/>
</lcub:ViewXY.XAxes>
<lcub:ViewXY.PointLineSeries>
<lcub:PointLineSeries Points="{Binding ElementName=thisTest, Path = Points}" PointsVisible="True"/>
</lcub:ViewXY.PointLineSeries>
</lcub:ViewXY>
</lcub:LightningChartUltimate.ViewXY>
</lcub:LightningChartUltimate>
</Grid>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Random rand = new Random();
SeriesPointCollection points0 = new SeriesPointCollection();
for (int i = 0; i < 10; i++)
{
SeriesPoint p = new SeriesPoint();
p.X = i;
p.Y = rand.NextDouble() * 10.0;
points0.Add(p);
}
Points = points0;
}
public static readonly DependencyProperty PointsProperty =
DependencyProperty.Register(
"Points",
typeof(SeriesPointCollection),
typeof(MainWindow)
);
public SeriesPointCollection Points
{
get { return GetValue(PointsProperty) as SeriesPointCollection; }
set { SetValue(PointsProperty, value as Object); }
}
}
を
良い説明相違の表現。私はあなたのスイートにスタンドアロンのバインディングプロジェクトがあることに気付きました。この簡単な例をありがとう。 –