时间:2023-05-24 07:18:02 | 来源:网站运营
时间:2023-05-24 07:18:02 来源:网站运营
.NET商业图表库SciChart开发实例:SciChart是一个用于.NET的商业图表库,用于高性能交互式图表。虽然他们有移动(iOS和Android)库,但在这里我们将仔细看看他们的WPF图表库。可以在Windows窗体应用程序中使用ElementHost或更现代的技术使用此控件,但它们的核心产品旨在用于WPF应用程序。<ext:SciChartInteractionToolbar TargetSurface="{Binding Source={x:Reference Name=sciChart}}"/><!-- Create the chart surface --><s:SciChartSurface x:Name="sciChart" Grid.Column="1"> <!-- Declare RenderableSeries --> <s:SciChartSurface.RenderableSeries> <s:FastLineRenderableSeries x:Name="lineRenderSeries" Stroke="#FF99EE99" StrokeThickness="2"> <s:FastLineRenderableSeries.SeriesAnimation> <s:SweepAnimation AnimationDelay="0:0:1" Duration="0:0:5"/> </s:FastLineRenderableSeries.SeriesAnimation> </s:FastLineRenderableSeries> </s:SciChartSurface.RenderableSeries> <!-- Create an X Axis with GrowBy --> <s:SciChartSurface.XAxis> <s:NumericAxis DrawMajorBands="True" FlipCoordinates="True" GrowBy="0.1, 0.1"/> </s:SciChartSurface.XAxis> <!-- Create a Y Axis with GrowBy. Optional bands give a cool look and feel for minimal performance impact --> <s:SciChartSurface.YAxis> <s:NumericAxis DrawMajorBands="True" GrowBy="0.5, 0.5"/> </s:SciChartSurface.YAxis></s:SciChartSurface>
数据必须加载到自定义对象中才能在图表中显示:private void LineChartExampleView_OnLoaded(object sender, RoutedEventArgs e){ // Create a DataSeries of type X=double, Y=double var dataSeries = new XyDataSeries<double, double>(); lineRenderSeries.DataSeries = dataSeries; var data = DataManager.Instance.GetFourierSeries(1.0, 0.1); // Append data to series. SciChart automatically redraws dataSeries.Append(data.XData, data.YData); sciChart.ZoomExtents();}
关键词:实例,商业,图表