WPF 自定义控件完成库容表盘显示效果

news2024/11/25 11:01:19

先看一下显示效果:

       需要注意的地方有以下几点:

  1. 表盘的刻度分部,长刻度和短刻度显示。
  2. 在数值80W时,需要更改刻度盘的颜色渐变。
  3. 在数值80W时,更改库容总数背景的显示,也是颜色渐变。刻度盘控件属性定义:

刻度盘的定义:

using Microsoft.Expression.Shapes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace Dashboard_Demo
{
    /// <summary>
    /// 刻度盘控件
    /// </summary>
    /// <remarks>add by zhidanfeng 2017.2.19</remarks>
    [TemplatePart(Name = "PART_IncreaseCircle", Type = typeof(Arc))]
    public class Dashboard : Control
    {
        private Arc PART_IncreaseCircle;
        /// <summary>
        /// 保存角度变化前的角度值(用于动画)
        /// </summary>
        private double OldAngle;

        #region Constructors
        static Dashboard()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(Dashboard), new FrameworkPropertyMetadata(typeof(Dashboard)));
        }
        #endregion

        #region 依赖属性

        #region Angle 刻度盘起始角度
        /// <summary>
        /// 刻度盘起始角度依赖属性
        /// </summary>
        public static readonly DependencyProperty StartAngleProperty =
            DependencyProperty.Register(
                "StartAngle",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(0d));

        /// <summary>
        /// 刻度盘起始角度
        /// </summary>
        public double StartAngle
        {
            get { return (double)GetValue(StartAngleProperty); }
            set { SetValue(StartAngleProperty, value); }
        }
        #endregion

        #region Angle 刻度盘结束角度依赖属性
        /// <summary>
        /// 刻度盘结束角度依赖属性
        /// </summary>
        public static readonly DependencyProperty EndAngleProperty =
            DependencyProperty.Register(
                "EndAngle",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(0d));

        /// <summary>
        /// 刻度盘结束角度依赖属性
        /// </summary>
        public double EndAngle
        {
            get { return (double)GetValue(EndAngleProperty); }
            set
            {
                SetValue(EndAngleProperty, value);
            }
        }
        #endregion

        #region Minimum 最小值
        /// <summary>
        /// 最小值依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty MinimumProperty =
            DependencyProperty.Register(
                "Minimum",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(0.0));

        /// <summary>
        /// 获取或设置最小值.
        /// </summary>
        /// <value>最小值.</value>
        public double Minimum
        {
            get { return (double)GetValue(MinimumProperty); }
            set { SetValue(MinimumProperty, value); }
        }
        #endregion

        #region Maximum 最大值
        /// <summary>
        /// 最大值依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty MaximumProperty =
            DependencyProperty.Register(
                "Maximum",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(100.0));

        /// <summary>
        /// 获取或设置最大值.
        /// </summary>
        /// <value>最大值.</value>
        public double Maximum
        {
            get { return (double)GetValue(MaximumProperty); }
            set { SetValue(MaximumProperty, value); }
        }
        #endregion

        #region Value 当前值
        /// <summary>
        /// 最大值依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty ValueProperty =
            DependencyProperty.Register(
                "Value",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(0.0, new PropertyChangedCallback(OnValuePropertyChanged)));

        /// <summary>
        /// 获取或设置当前值
        /// </summary>
        public double Value
        {
            get
            {
                if (PART_IncreaseCircle == null)
                    return (double)GetValue(ValueProperty);

                if ((double)GetValue(ValueProperty) > 800000d)
                {
                    LinearGradientBrush brush = new LinearGradientBrush();
                    brush.StartPoint = new Point(0, 0);
                    brush.EndPoint = new Point(1, 0);
                    brush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#f0b046"), 0));
                    brush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#e83a2d"), 1));
                    PART_IncreaseCircle.Stroke = brush;
                }
                else
                {
                    LinearGradientBrush brush = new LinearGradientBrush();
                    brush.StartPoint = new Point(0, 0);
                    brush.EndPoint = new Point(1, 0);
                    brush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#1ccabd"), 0));
                    brush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#458ffc"), 1));
                    PART_IncreaseCircle.Stroke = brush;
                }
                return (double)GetValue(ValueProperty);

            }
            set { SetValue(ValueProperty, value); }
        }

        private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Dashboard dashboard = d as Dashboard;
            dashboard.OldAngle = dashboard.Angle;
            dashboard.SetAngle();
            dashboard.TransformAngle();
        }
        #endregion

        #region LongTickCount 长刻度个数
        public static readonly DependencyProperty LongTickCountProperty =
            DependencyProperty.Register(
                "LongTickCount",
                typeof(int),
                typeof(Dashboard),
                new PropertyMetadata(5));

        /// <summary>
        /// 获取或设置长刻度个数,用于设置刻度盘显示几个长刻度
        /// </summary>
        public int LongTickCount
        {
            get { return (int)GetValue(LongTickCountProperty); }
            set { SetValue(LongTickCountProperty, value); }
        }
        #endregion

        #region ShortTickCount 短刻度个数
        public static readonly DependencyProperty ShortTickCountProperty =
            DependencyProperty.Register(
                "ShortTickCount",
                typeof(int),
                typeof(Dashboard),
                new PropertyMetadata(3));

        /// <summary>
        /// 获取或设置两个长刻度之间的短刻度的个数
        /// </summary>
        public int ShortTickCount
        {
            get { return (int)GetValue(ShortTickCountProperty); }
            set { SetValue(ShortTickCountProperty, value); }
        }
        #endregion

        #region TickDurtion 刻度改变时的动画显示时长
        public static readonly DependencyProperty TickDurtionProperty = DependencyProperty.Register("TickDurtion"
            , typeof(Duration)
            , typeof(Dashboard),
            new PropertyMetadata(new Duration(TimeSpan.FromMilliseconds(400))));

        /// <summary>
        /// 刻度改变时的动画显示时长
        /// </summary>
        public Duration TickDurtion
        {
            get { return (Duration)GetValue(TickDurtionProperty); }
            set { SetValue(TickDurtionProperty, value); }
        }
        #endregion

        #region ShortTicksBrush 短刻度颜色
        public static readonly DependencyProperty ShortTicksBrushProperty = DependencyProperty.Register("ShortTicksBrush"
            , typeof(Brush)
            , typeof(Dashboard));

        /// <summary>
        /// 短刻度颜色
        /// </summary>
        public Brush ShortTicksBrush
        {
            get { return (Brush)GetValue(ShortTicksBrushProperty); }
            set { SetValue(ShortTicksBrushProperty, value); }
        }
        #endregion

        #region LongTicksBrush 长刻度颜色
        public static readonly DependencyProperty LongTicksBrushProperty = DependencyProperty.Register("LongTicksBrush"
            , typeof(Brush)
            , typeof(Dashboard));

        /// <summary>
        /// 长刻度颜色
        /// </summary>
        public Brush LongTicksBrush
        {
            get { return (Brush)GetValue(LongTicksBrushProperty); }
            set { SetValue(LongTicksBrushProperty, value); }
        }
        #endregion

        #region Content
        public object Content
        {
            get { return (object)GetValue(ContentProperty); }
            set { SetValue(ContentProperty, value); }
        }

        public static readonly DependencyProperty ContentProperty =
            DependencyProperty.Register("Content", typeof(object), typeof(Dashboard));
        #endregion

        #region ContentTemplate
        public DataTemplate ContentTemplate
        {
            get { return (DataTemplate)GetValue(ContentTemplateProperty); }
            set { SetValue(ContentTemplateProperty, value); }
        }

        public static readonly DependencyProperty ContentTemplateProperty =
            DependencyProperty.Register("ContentTemplate", typeof(DataTemplate), typeof(Dashboard));
        #endregion

        #endregion

        #region Private依赖属性

        #region Angle 刻度盘当前值所对应的角度
        /// <summary>
        /// 刻度盘当前值所对应的角度依赖属性
        /// </summary>
        public static readonly DependencyProperty AngleProperty =
            DependencyProperty.Register(
                "Angle",
                typeof(double),
                typeof(Dashboard),
                new PropertyMetadata(0d));

        /// <summary>
        /// 刻度盘当前值所对应的角度
        /// </summary>
        public double Angle
        {
            get { return (double)GetValue(AngleProperty); }
            private set { SetValue(AngleProperty, value); }
        }
        #endregion

        #region ShortTicks 短刻度线集合
        /// <summary>
        /// 短刻度线依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty ShortTicksProperty =
            DependencyProperty.Register(
                "ShortTicks",
                typeof(IList<object>),
                typeof(Dashboard),
                new PropertyMetadata(null));

        /// <summary>
        /// 获取或设置短刻度线,用于绑定PathListBox的ItemsSource
        /// </summary>
        /// <value>短刻度线.</value>
        public IList<object> ShortTicks
        {
            get { return (IList<object>)GetValue(ShortTicksProperty); }
            private set { SetValue(ShortTicksProperty, value); }
        }
        #endregion

        #region LongTicks 长刻度线集合
        /// <summary>
        /// 长刻度线依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty LongTicksProperty =
            DependencyProperty.Register(
                "LongTicks",
                typeof(IList<object>),
                typeof(Dashboard),
                new PropertyMetadata(null));

        /// <summary>
        /// 获取或设置长刻度线,用于绑定PathListBox的ItemsSource
        /// </summary>
        /// <value>长刻度线.</value>
        public IList<object> LongTicks
        {
            get { return (IList<object>)GetValue(LongTicksProperty); }
            private set { SetValue(LongTicksProperty, value); }
        }
        #endregion

        #region LongTicks 长刻度线上显示的数字
        /// <summary>
        /// 长刻度线依赖属性,用于Binding
        /// </summary>
        public static readonly DependencyProperty NumberListProperty =
            DependencyProperty.Register(
                "NumberList",
                typeof(IList<object>),
                typeof(Dashboard),
                new PropertyMetadata(null));

        /// <summary>
        /// 获取或设置长刻度线,用于绑定PathListBox的ItemsSource
        /// </summary>
        /// <value>长刻度线.</value>
        public IList<object> NumberList
        {
            get { return (IList<object>)GetValue(NumberListProperty); }
            private set { SetValue(NumberListProperty, value); }
        }
        #endregion

        #endregion

        #region 重载
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.PART_IncreaseCircle = GetTemplateChild("PART_IncreaseCircle") as Arc;

            this.SetTicks();
            this.SetAngle();
            this.TransformAngle();
        }
        #endregion

        #region Private方法
        /// <summary>
        /// 设置刻度线
        /// </summary>
        private void SetTicks()
        {
            List<object> numbers = new List<object>();
            List<object> shortticks = new List<object>();
            List<object> longticks = new List<object>();

            for (int i = 0; i < this.LongTickCount; i++)
            {
                numbers.Add(Math.Round(this.Minimum + (this.Maximum - this.Minimum) / (this.LongTickCount - 1) * i));
                longticks.Add(new object());
            }

            for (int i = 0; i < (this.LongTickCount - 1) * (this.ShortTickCount + 1) + 1; i++)
            {
                shortticks.Add(new object());
            }

            this.ShortTicks = shortticks;
            this.LongTicks = longticks;
            this.NumberList = numbers;
        }

        /// <summary>
        /// 根据当前值设置圆弧的EndAngle
        /// </summary>
        private void SetAngle()
        {
            if (this.Value < this.Minimum)
            {
                this.Angle = this.StartAngle;
                return;
            }

            if (this.Value > this.Maximum)
            {
                this.Angle = this.EndAngle;
                return;
            }

            var diff = this.Maximum - this.Minimum;
            var valueDiff = this.Value - this.Minimum;
            this.Angle = this.StartAngle + (this.EndAngle - this.StartAngle) / diff * valueDiff;
        }

        /// <summary>
        /// 角度值变化动画
        /// </summary>
        private void TransformAngle()
        {
            if (this.PART_IncreaseCircle != null)
            {
                DoubleAnimation doubleAnimation = new DoubleAnimation(this.OldAngle, this.Angle, this.TickDurtion);
                this.PART_IncreaseCircle.BeginAnimation(Arc.EndAngleProperty, doubleAnimation);
            }
        }
        #endregion
    }
}

设置刻度盘的style:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
                    xmlns:ec="http://schemas.microsoft.com/expression/2010/controls" 
                    xmlns:local ="clr-namespace:Dashboard_Demo">
    <!--  流量盘  -->
    <ControlTemplate x:Key="Flow" TargetType="{x:Type local:Dashboard}">
        <Grid>
            <!--  刻度盘完整圆弧  -->
            <ed:Arc x:Name="DoubleCircle" Margin="50" ArcThickness="3" ArcThicknessUnit="Pixel"
                    EndAngle="{TemplateBinding EndAngle}"
                    SnapsToDevicePixels="True"
                    StartAngle="{TemplateBinding StartAngle}"
                    Stretch="None" Stroke="#002266" Opacity="0.16" StrokeThickness="3" UseLayoutRounding="True" />

            <!--  刻度盘当前值对应的圆弧  -->
            <ed:Arc x:Name="PART_IncreaseCircle" Margin="50" ArcThickness="3" ArcThicknessUnit="Pixel"
                    RenderTransformOrigin="0.5,0.5"
                    StartAngle="{TemplateBinding StartAngle}"
                    Stretch="None"  StrokeThickness="3" />

            <!--  短刻度  -->
            <ec:PathListBox x:Name="ShoartTick" IsHitTestVisible="False"
                            ItemsSource="{TemplateBinding ShortTicks}">
                <ec:PathListBox.ItemTemplate>
                    <DataTemplate>
                        <Border Width="1" Height="8"
                                Background="{Binding ShortTicksBrush,
                                                     RelativeSource={RelativeSource AncestorType={x:Type local:Dashboard}}}"
                                SnapsToDevicePixels="True" UseLayoutRounding="False" />
                    </DataTemplate>
                </ec:PathListBox.ItemTemplate>
                <ec:PathListBox.LayoutPaths>
                    <ec:LayoutPath Distribution="Even" Orientation="OrientToPath"
                                   SourceElement="{Binding ElementName=ShortTickPath}" />
                </ec:PathListBox.LayoutPaths>
            </ec:PathListBox>

            <!--  长刻度  -->
            <ec:PathListBox x:Name="LongTick" IsHitTestVisible="False"
                            ItemsSource="{TemplateBinding LongTicks}">
                <ec:PathListBox.ItemTemplate>
                    <DataTemplate>
                        <Border Width="1" Height="13"
                                Background="{Binding LongTicksBrush,
                                                     RelativeSource={RelativeSource AncestorType={x:Type local:Dashboard}}}"
                                SnapsToDevicePixels="True" UseLayoutRounding="False" />
                    </DataTemplate>
                </ec:PathListBox.ItemTemplate>
                <ec:PathListBox.LayoutPaths>
                    <ec:LayoutPath Distribution="Even" Orientation="OrientToPath"
                                   SourceElement="{Binding ElementName=LongTickPath}" />
                </ec:PathListBox.LayoutPaths>
            </ec:PathListBox>

            <!--  刻度上显示的数字  -->
            <ec:PathListBox x:Name="Number" IsHitTestVisible="False"
                            ItemsSource="{TemplateBinding NumberList}">
                <ec:PathListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock RenderTransformOrigin="0.5,0.5" Text="{Binding}">
                        </TextBlock>
                    </DataTemplate>
                </ec:PathListBox.ItemTemplate>
                <ec:PathListBox.LayoutPaths>
                    <ec:LayoutPath Distribution="Even" Orientation="OrientToPath"
                                   SourceElement="{Binding ElementName=NumberPath}" />
                </ec:PathListBox.LayoutPaths>
            </ec:PathListBox>

            <!--#region 路径-->


            <ed:Arc x:Name="ShortTickPath" Margin="30" ArcThickness="0" ArcThicknessUnit="Pixel"
                    EndAngle="{TemplateBinding EndAngle}"
                    StartAngle="{TemplateBinding StartAngle}"
                    Stretch="None" />
            <ed:Arc x:Name="LongTickPath" Margin="25" ArcThickness="0" ArcThicknessUnit="Pixel"
                    EndAngle="{TemplateBinding EndAngle}"
                    StartAngle="{TemplateBinding StartAngle}"
                    Stretch="None" />
            <ed:Arc x:Name="NumberPath" Margin="10" ArcThickness="0" ArcThicknessUnit="Pixel"
                    EndAngle="{TemplateBinding EndAngle}"
                    StartAngle="{TemplateBinding StartAngle}"
                    Stretch="None" />

            <!--#endregion-->

            <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
        </Grid>
    </ControlTemplate>

    <DataTemplate x:Key="DefaultLabelPanel" x:Shared="False">
        <Border Width="70" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom"
                BorderBrush="#00A0FB" BorderThickness="1" CornerRadius="3" Padding="0,2"
                SnapsToDevicePixels="True" UseLayoutRounding="True">
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Agency FB" Foreground="White"
                       Text="{Binding Path=Value,
                                      StringFormat={}{0:N1}KW,
                                      RelativeSource={RelativeSource Mode=FindAncestor,
                                                                     AncestorType={x:Type local:Dashboard}}}" />
        </Border>
    </DataTemplate>

    <Style TargetType="{x:Type local:Dashboard}">
        <Setter Property="StartAngle" Value="-140" />
        <Setter Property="EndAngle" Value="140" />
        <Setter Property="Foreground" Value="#929093" />
        <Setter Property="BorderBrush" Value="#746E7A" />
        <Setter Property="ShortTicksBrush" Value="#746E7A" />
        <Setter Property="LongTicksBrush" Value="#746E7A" />
        <Setter Property="Template" Value="{StaticResource Flow}" />
        <Setter Property="ContentTemplate" Value="{StaticResource DefaultLabelPanel}" />
    </Style>

    <LinearGradientBrush x:Key="LargeArcCenterBackground" StartPoint="0.0,0" EndPoint="0,1">
        <GradientStop Color="#d84a36" Offset="0"/>
        <GradientStop Color="#ec7c6c" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="LargeOutArcBackground" StartPoint="0.0,0" EndPoint="0,1">
        <GradientStop Color="#e2aaa3" Offset="0"/>
        <GradientStop Color="#e4b4ac" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="LargeBorderArcBackground" StartPoint="0.0,0" EndPoint="0,1">
        <GradientStop Color="#e3d5d3" Offset="0"/>
        <GradientStop Color="#e4d8d6" Offset="1"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="SmallArcCenterBackground" StartPoint="0.0,0" EndPoint="0,1">
        <GradientStop Color="#389cfa" Offset="0"/>
        <GradientStop Color="#73b8fd" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SmallOutArcBackground" StartPoint="0.0,0" EndPoint="0,1" Opacity="0.4">
        <GradientStop Color="#389AfC" Offset="0"/>
        <GradientStop Color="#78AEFC" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="SmallBorderArcBackground" StartPoint="0.0,0" EndPoint="0,1" Opacity="0.1">
        <GradientStop Color="#389AfC" Offset="0"/>
        <GradientStop Color="#78AEFC" Offset="1"/>
    </LinearGradientBrush>
</ResourceDictionary>
  • 库容总数背景渐变实现:
  • <DataTemplate x:Key="Small">
                <Grid Margin="0,110,0,0" HorizontalAlignment="Center">
                    <Ellipse x:Name="ellipse1" Width="166" Height="166" Fill="{StaticResource SmallBorderArcBackground}" Margin="0 -43" VerticalAlignment="Top"/>
                    <Ellipse x:Name="ellipse2" Width="147" Height="147" Fill="{StaticResource SmallOutArcBackground}" Margin="0 -33" VerticalAlignment="Top"/>
                    <Ellipse x:Name="ellipse3" Width="133" Height="133" Fill="{StaticResource SmallArcCenterBackground}" Margin="0 -25" VerticalAlignment="Top"/>
                    <TextBlock Margin="0,30" HorizontalAlignment="Center" FontSize="24" Foreground="White" FontWeight="Bold"
                                               Text="{Binding Path=Value,
                                                              StringFormat={}{0:N0},
                                                              ElementName=dashboard1}" />
                </Grid>
            </DataTemplate>
    
            <DataTemplate x:Key="Large">
                <Grid Margin="0,110,0,0" HorizontalAlignment="Center">
                    <Ellipse x:Name="ellipse1" Width="166" Height="166" Fill="{StaticResource LargeBorderArcBackground}" Margin="0 -43" VerticalAlignment="Top"/>
                    <Ellipse x:Name="ellipse2" Width="147" Height="147" Fill="{StaticResource LargeOutArcBackground}" Margin="0 -33" VerticalAlignment="Top"/>
                    <Ellipse x:Name="ellipse3" Width="133" Height="133" Fill="{StaticResource LargeArcCenterBackground}" Margin="0 -25" VerticalAlignment="Top"/>
                    <TextBlock Margin="0,30" HorizontalAlignment="Center" FontSize="24" Foreground="White" FontWeight="Bold"
                                               Text="{Binding Path=Value,
                                                              StringFormat={}{0:N0},
                                                              ElementName=dashboard1}" />
                </Grid>
            </DataTemplate>

    实现效果(低于80W):

  • 高于80W时显示:

  • csdn下载地址:https://download.csdn.net/download/chulijun3107/88058570

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/765936.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

印刷企业如何利用MES管理系统实现智能计划排产

在数字化时代&#xff0c;印刷企业面临着日益激烈的市场竞争和不断攀升的成本压力。为了提高生产效率和质量&#xff0c;印刷企业需要采用先进的生产管理系统。其中&#xff0c;MES生产管理系统已成为实现智能计划排产的重要工具。本文将探讨如何利用印刷MES管理系统实现印刷企…

界面控件DevExtreme PivotGrid,拥有新的HTML编码体验!

虽然DevExtreme刚刚发布了v23.1&#xff0c;但今天我们仍然要继续总结一下之前的主要更新&#xff08;v22.2&#xff09;中发布的一些与DevExtreme PivotGrid&#xff08;透视网格&#xff09;组件相关的重要特性。 DevExtreme拥有高性能的HTML5 / JavaScript小部件集合&#…

Django + Bootstrap - 【echart】 统计图表进阶使用-统计用户日活日增、月活月增等数据(二)

一. 前言 Bootstrap是一个流行的前端框架&#xff0c;而ECharts是一个流行的可视化库。 Bootstrap可以用来设计网站和应用程序的用户界面&#xff0c;而ECharts可以用来创建交互式和可视化的图表。 chart.js中文文档&#xff1a;http://www.bootcss.com/p/chart.js/docs/ 二. …

手把手教你搭建SpringCloud项目(六)Eureka实现服务发现

一、服务发现简介 各个微服务在启动时&#xff0c;将自己的网络地址等信息注册到服务发现组件上(eureka,zookeeper,Consul),服务发现组件会存储这些信息。服务消费者会从服务发现组件查询服务提供者的网络地址&#xff0c;然后根据该地址调用服务提供者的接口。各个微服务与服务…

centos升级龙蜥

centos升级龙蜥 龙蜥简介龙蜥官方社区centos升级龙蜥首先确认自己的centos版本下载迁移镜像源安装epel源迁移工具安装i686包查看执行迁移脚本结果查看重启机器查看系统信息 龙蜥简介 2021年10月19日的大会上&#xff0c;阿里云发布全新操作系统“龙蜥”并宣布开源。龙蜥操作系…

SAP与顺丰快递接口签名验证加密ABAP程序例子(MD5加密、转换为Base64字符串) <转载>

原文链接&#xff1a;http://www.baidusap.com/abap/7408 1, 顺丰平台数字签名简介 SAP系统和顺丰快递平台中的API接口对接时&#xff0c;需要将传输的JSON字符串进行数字签名加密。数字签名具体使用的是MD5方式&#xff0c;格式如下&#xff1a;msgData&#xff08;业务报文&a…

DOM编程

DOM编程 DOM树&#xff1a; 获取DOM对象的方式&#xff1a; 通过id直接获取 id禁止使用&#xff0c;因为项目都是css、html、js分离的 2、通过API&#xff0c;doucument.getElementById 3、通过class&#xff0c;doucument.getElementsByClassName 4、通过标签名称&#xff0…

【框架篇】Bean作用域和生命周期

Bean作用域和生命周期 一&#xff0c;Bean作用域 Bean作用域指的是在Spring框架中&#xff0c;定义了Bean实例的创建和销毁方式&#xff0c;以及可以访问该实例的范围&#xff0c;并决定了每次通过容器获取Bean时返回的是同一个实例还是不同的实例。 1.1&#xff0c;Bean作用…

mysql 2 -- 数据库基本操作、数据表的操作、mysql查询操作

一、数据库基本操作 1、数据库的登录及退出 连接数据库&#xff1a; mysql -u用户名 -h主机地址(省略代表本机) -p 密码&#xff08;格式为123...&#xff09;;注&#xff1a; 刚下载安装的时候需要通过管理员进入 退出数据库,以下三种方式都可以&#xff1a; exit quit …

Spring:表达式语言

Spring EL 概述使用概述 Spring 表达式(Spring EL) 是一种功能强大的表达式语言,以 #{ 表达式 } 作为定界符,用于在运行时对对象进行访问和操作。通过使用 Spring 表达式达到简化开发、减少逻辑或配置的编写的目的。 使用 Spring EL 主要可以引用 bean ,调用其属性和方…

苹果手机备忘录如何导入新手机?手机备忘录怎么转移?

一般来说&#xff0c;大多数手机用户更换手机的频率是3—5年&#xff0c;在一部手机使用了几年之后&#xff0c;就会出现内存不足、系统卡顿、电池续航时间较短等问题&#xff0c;这时候就需要更换新的手机了。有不少苹果手机用户在更换新手机的时候&#xff0c;都很发愁一个问…

Hugging News #0717: 开源大模型榜单更新、音频 Transformers 课程完成发布!

每一周&#xff0c;我们的同事都会向社区的成员们发布一些关于 Hugging Face 相关的更新&#xff0c;包括我们的产品和平台更新、社区活动、学习资源和内容更新、开源库和模型更新等&#xff0c;我们将其称之为「Hugging News」。本期 Hugging News 有哪些有趣的消息&#xff0…

TypeScript 学习笔记(六):索引签名类型、映射类型

一、索引签名类型 1. 索引类型查询操作符 keyof keyof可以用于获取某种类型的所有键&#xff0c;其返回类型是联合类型。 interface Info {name: string;age: number; } let infoProp: keyof Info; infoProp "name"; infoProp "age"; infoProp "…

知识普及:Boc-Hynic,133081-25-1,6-叔丁氧羰肼基-3-吡啶甲酸,

&#xff08;文章资料汇总来源于&#xff1a;陕西新研博美生物科技有限公司小编MISSwu&#xff09;​ Boc-Hynic&#xff0c;6-[2-(tert-Butoxycarbonyl)hydrazinyl]nicotinic acid&#xff0c;6-[2-(叔丁氧羰基)肼基]烟酸&#xff0c;6-叔丁氧羰肼基-3-吡啶甲酸 ------------…

追梦之旅【数据结构篇】——C语言手撕八大经典排序

追梦之旅【数据结构篇】——C语言手撕八大经典排序&#x1f60e; 前言&#x1f64c;排序的认识排序的稳定性&#xff1a;排序的时间复杂度和空间复杂度以及如何选择适合的排序&#xff1a; 优化版选择排序冒泡排序普通版冒泡排序升级版冒泡排序 直接插入排序希尔排序堆排序快速…

ChatGPT变现五个思路

一、前言 ChatGPT是一款AI聊天机器人&#xff0c;发布于2022年11月。凭借着在广泛的知识领域为消费者问题做出清晰、详尽解答的出色能力&#xff0c;其一经推出就引发全球轰动&#xff0c;自然也得到零售行业的高度关注。例如&#xff0c;消费者只要询问ChatGPT如何布置一个梦…

将Spring Boot项目打包部署到阿里云linux服务器

首先 你要保证自己的服务器上有java环境 如果没有可以参考我的文章 linux服务器中安装java JDK1.8版本 然后 我们打开我们的Spring Boot项目 双击 package 生命周期进行打包 打包完成之后 我们找到 target 下面会有一个jar包 然后 我们右键它 如下图操作 系统就会帮你打开它所…

javascript 导出表格的excel

一个php网站的表格,需要增加导出excel的功能, 因对web开发不甚了解,开始想着用php导出, 搜索一番发现比较复杂,而且我的表格里已经有数据了, 如果导出又要去库中获取一次,不是负担加倍, 可否把现有表格数据,直接导出来? 答案是肯定的,用js在前端导出 开源js组件…

三个属性让你学会书写横向滑动窗口!内附代码和详解!

先说结论&#xff1a; 父组件添加&#xff1a; display: flex; overflow-x: auto; 子组件添加&#xff1a; flex-shrink: 0; 下面进行详细讲述。 在书写滑动页面之前&#xff0c;最好了解一下flex布局的基本原理和常用属性&#xff0c;以下链接介绍较详细&#xff0c;图文并…

ROS1 ROS2学习

ROS1 ROS2学习 安装 ROSROS1ROS2 命令行界面ROS2 功能包相关指令ROS 命令行工具ROS1 CLI工具ROS2 CLI工具 ROS 通信核心概念节点 - Node节点相关的CLI 话题 - Topic编写发布者程序流程&#xff1a;编写订阅者程序流程&#xff1a;话题相关的CLI 服务 - Service编写客户端程序流…