c# wpf LiveCharts 简单试验

1.概要

1.1 说明

1.2 环境准备

NuGet 添加插件安装

 

2.代码

<Window x:Class="WpfApp3.MainWindow"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
        xmlns:local="clr-namespace:WpfApp3"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <lvc:CartesianChart LegendLocation="Bottom" >
            <lvc:CartesianChart.Series>
                <lvc:LineSeries Fill="LightGreen" Stroke="Green"
                        Values="12,34,55,40,30,54,26"  Title="消费" DataLabels="True"/>
            </lvc:CartesianChart.Series>
        </lvc:CartesianChart>
    </Grid>
</Window>

 

using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using LiveCharts;
using LiveCharts.Wpf;

namespace WpfApp3
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}

3.运行效果

相关推荐

  1. 简单试验:用Excel进行爬虫

    2024-04-07 14:20:03       46 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-07 14:20:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-07 14:20:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-07 14:20:03       82 阅读
  4. Python语言-面向对象

    2024-04-07 14:20:03       91 阅读

热门阅读

  1. vite配置postcss

    2024-04-07 14:20:03       35 阅读
  2. AI创业蓝海:十大领域解锁未来商机

    2024-04-07 14:20:03       30 阅读
  3. docker用来解决什么问题

    2024-04-07 14:20:03       41 阅读
  4. vue3项目中使用getCurrentInstance获取实例和dom的问题

    2024-04-07 14:20:03       27 阅读
  5. Linux 系统调用

    2024-04-07 14:20:03       35 阅读
  6. 前2个月湖南外贸进出口总值810.6亿元

    2024-04-07 14:20:03       35 阅读
  7. MyBatis实战:如何将拼接的SQL打印到日志

    2024-04-07 14:20:03       36 阅读
  8. 24双非考研哈尔滨工程大学计算机(@程程笔记)

    2024-04-07 14:20:03       71 阅读
  9. [Pytorch][缘来如此]:PyTorch中的广播机制

    2024-04-07 14:20:03       31 阅读
  10. 【软设】知识点速记3

    2024-04-07 14:20:03       29 阅读
  11. 播放器的音视频不同步问题:ffplay

    2024-04-07 14:20:03       31 阅读
  12. 六、Mybatis-动态SQL

    2024-04-07 14:20:03       33 阅读