Scichart for WPF 初体验

  领导要求写一个数据分析软件,特点是数据量超级大,要求是快速准确绘图。

接下来给大家看一下Scichart强大的存在。

  • 先安装Scichart控件

       下载地址:https://download.csdn.net/download/qq_41270634/12277623

  • 我们打开软件看一看

  • 选择我们需要的2D Scatter Chart 图表

  • 我们来看下他的Source Code  (前端)
<UserControl x:Class="SciChart.Examples.Examples.CreateSimpleChart.ScatterChartExampleView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="http://schemas.abtsoftware.co.uk/scichart/exampleExternals" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="http://schemas.abtsoftware.co.uk/scichart" d:DesignHeight="400" d:DesignWidth="600" Loaded="ScatterChartExampleView_Loaded" mc:Ignorable="d">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <ext:SciChartInteractionToolbar TargetSurface="{Binding Source={x:Reference Name=sciChart}}"/>

        <!--  Create the chart surface  -->
        <s:SciChartSurface Name="sciChart" Grid.Column="1" Padding="0" BorderThickness="0">

            <!--  Declare RenderableSeries  -->
            <s:SciChartSurface.RenderableSeries>
                <s:XyScatterRenderableSeries x:Name="scatterRenderSeries">
                    <s:XyScatterRenderableSeries.PointMarker>
                        <s:EllipsePointMarker Width="9" Height="9" Fill="SteelBlue" Stroke="LightSteelBlue" StrokeThickness="2"/>
                    </s:XyScatterRenderableSeries.PointMarker>

                    <s:XyScatterRenderableSeries.SeriesAnimation>
                        <s:ScaleAnimation AnimationDelay="0:0:1" Duration="0:0:2"/>
                    </s:XyScatterRenderableSeries.SeriesAnimation>

                </s:XyScatterRenderableSeries>
            </s:SciChartSurface.RenderableSeries>

           <!--  Create an X Axis with Growby  -->
            <s:SciChartSurface.XAxis>
                <s:NumericAxis DrawMajorBands="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.1, 0.1"/>
            </s:SciChartSurface.YAxis>

        </s:SciChartSurface>

    </Grid>

</UserControl>

  • 我们来看下他的Source Code  (后端)
using System.Windows.Controls;
using SciChart.Charting.Model.DataSeries;
using SciChart.Examples.ExternalDependencies.Data;

namespace SciChart.Examples.Examples.CreateSimpleChart
{
    ///<summary>
    /// Interaction logic for ScatterChartExampleView.xaml
    ///</summary>
    public partial class ScatterChartExampleView : UserControl
    {
        public ScatterChartExampleView()
        {
            InitializeComponent();
        }

        private void ScatterChartExampleView_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            // Create a dataseries of type X=double, Y=double
            var dataSeries = new XyDataSeries<double, double>();

            var data = DataManager.Instance.GetDampedSinewave(1.0, 0.02, 200);

            // Append data to series. SciChart automatically redraws
            dataSeries.Append(data.XData, data.YData);

            scatterRenderSeries.DataSeries = dataSeries;

            sciChart.ZoomExtents();
        }
    }
}
  • 我们参考他的代码,先复制过来 前后端

       我们还需要添加引用库.dll  路径在安装文件夹下的Lib文件夹下选择对应的.net

我添加了

  • 这是我们就可以运行程序了,就会显示出和scichart一样的散点图
  • 给大家看下我修改后运行大量数据的散点图

  • 控件直接支持放大和缩小,一直选择区域进行放大

总结一下,Scichart控件在数据处理上真的是超快速,还有支持各种2D3D图表,Livechart 在大数据上显示就不太友好。

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值