WeChart.Toolkit.WindChart 1.0.0-beta

This is a prerelease version of WeChart.Toolkit.WindChart.
There is a newer version of this package available.
See the version list below for details.
dotnet add package WeChart.Toolkit.WindChart --version 1.0.0-beta                
NuGet\Install-Package WeChart.Toolkit.WindChart -Version 1.0.0-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WeChart.Toolkit.WindChart" Version="1.0.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WeChart.Toolkit.WindChart --version 1.0.0-beta                
#r "nuget: WeChart.Toolkit.WindChart, 1.0.0-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WeChart.Toolkit.WindChart as a Cake Addin
#addin nuget:?package=WeChart.Toolkit.WindChart&version=1.0.0-beta&prerelease

// Install WeChart.Toolkit.WindChart as a Cake Tool
#tool nuget:?package=WeChart.Toolkit.WindChart&version=1.0.0-beta&prerelease                

Toolkit-WeChart

构建自定义&简洁的 Windows Presentation Foundation (WPF) 图表库

Build Custom and Simple WPF Charts Library

快速使用(Quick Start)

  1. 命名空间namespace引入

          xmlns:windchart="clr-namespace:WindChart;assembly=WindChart"
    
  2. 单线图应用示例

    单线图控件LineGram引入

    <Page x:Class="WindChart.ApplyDemo.Pages.LinegramPage"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
          xmlns:local="clr-namespace:WindChart.ApplyDemo.Pages"
          xmlns:windchart="clr-namespace:WindChart;assembly=WindChart"
          mc:Ignorable="d" 
          d:DesignHeight="450" d:DesignWidth="800"
          Title="LinegramPage">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="349*"/>
            </Grid.RowDefinitions>
            <ToggleButton Content="开始模拟" Margin="5,5,5,5"
                          Click="Simulate_Click"  />
            <Grid Grid.Row="1">
                <windchart:Linegram x:Name="line" Margin="20,20,20,20" XAxisBrush="Gray" YAxisScaleCount="4" Grid.Row="0"/>
            </Grid>
        </Grid>
    </Page>
    
    

    code behind调用DrawLine绘图

    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    
    namespace WindChart.ApplyDemo.Pages
    {
        /// <summary>
        /// Interaction logic for LinegramPage.xaml
        /// </summary>
        public partial class LinegramPage : Page
        {
            public LinegramPage()
            {
                InitializeComponent();
            }
    
            /// <summary>
            /// 模拟状态
            /// </summary>
            bool IsSimulated = false;
    
            /// <summary>
            /// 开始/停止模拟
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void Simulate_Click(object sender, RoutedEventArgs e)
            {
                if (IsSimulated)
                {
                    IsSimulated = false;
                }
                else
                {
                    IsSimulated = true;
                    Task.Run(() =>
                    {
                        int x = 0;
                        int y = 0;
                        while (IsSimulated)
                        {
                            // 初始化图形
                            this.Dispatcher.Invoke(() =>
                            {
                                line.Init();
                            });
                            while (IsSimulated)
                            {
                                if (x > 500)
                                {
                                    x = 0;
                                    break;
                                }
    
                                // 生产一个随机点
                                var ran = Random.Shared.Next(-150, 150);
                                if (ran > 0)
                                {
                                    y -= Math.Abs(ran) / 10;
                                }
                                else
                                {
                                    y += Math.Abs(ran) / 10;
                                }
                                var p = new Point(x, y);
    
                                // 绘制一个随机点
                                this.Dispatcher.Invoke(() =>
                                {
                                    line.DrawLine(p);
                                });
                                x++;
                            }
                            Thread.Sleep(5000);
                        }
                    });
                }
            }
        }
    }
    
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net472 is compatible.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 198 8/27/2023
1.0.0-beta 186 9/23/2022
1.0.0-alpha 153 9/22/2022

Add net6.0-windows;netcoreapp3.1;net48;net472 TargetFramworks