原文:LiveCharts文档-3开始-5序列Series

LiveCharts文档-3开始-5序列Series

Strokes和Fills 笔触和填充

所有的Series都有笔触和填充属来处理颜色,都支持的是System.Windows.Media.Brush.你也可以使用复杂的填充和笔触,请参阅其他的文章。

mySeries.Fill = Brushes.Red;
mySeries.Stroke = Brushes.Blue;

Stroke 间隔和粗细

使用Series.StrokeThickness属性设置笔触粗细,使用Series.StrokeDashArray属性来设置间隔。

mySeries.StrokeDashArray = new DoubleCollection {2};

ZIndex 叠放顺序

每个series绘制的每个形状都绑定在Panel.ZIndex属性上,所以你可以非常容易的控制每个Series的叠放顺序。这里有一个小例子。

System.Windows.Controls.Panel.SetZIndex(mySeries, 0);
System.Windows.Controls.Panel.SetZIndex(mySeries, 1);
System.Windows.Controls.Panel.SetZIndex(mySeries, 2);

Visibility 可见性

所有绘制的形状也都绑定在Series.Visibility属性上,你可以在程序运行的时候很容易的控制series的可见性。

注意:所有stacked series(包括pie series)不仅会在可见性上有变化,同时也会从stakced值中移除这个series,整个chart都会被更新,如果这个series不存在的话。

特殊的属性

有一些属性只存在特定的series中,想要看关于定制series的更多信息,请查看之后的文章。

请看下面这个例子:

using System;
using System.Drawing;
using System.Windows.Forms;
using LiveCharts;
using LiveCharts.Wpf; namespace Winforms.Cartesian.Customized_Series
{
public partial class CustomizedSeries : Form
{
public CustomizedSeries()
{
InitializeComponent(); cartesianChart1.Series.Add(new LineSeries
{
Values = new ChartValues<double> { 3, 4, 6, 3, 2, 6 },
StrokeThickness = 4,
StrokeDashArray = new System.Windows.Media.DoubleCollection(20),
Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(107, 185, 69)),
Fill = System.Windows.Media.Brushes.Transparent,
LineSmoothness = 0,
PointGeometry = null
});
cartesianChart1.Series.Add(new LineSeries
{
Values = new ChartValues<double> { 5, 3, 5, 7, 3, 9 },
StrokeThickness = 2,
Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(28, 142, 196)),
Fill = System.Windows.Media.Brushes.Transparent,
LineSmoothness = 1,
PointGeometrySize = 15,
PointForeround =
new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(34, 46, 49))
}); cartesianChart1.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(34, 46, 49)); cartesianChart1.AxisX.Add(new Axis
{
IsMerged = true,
Separator = new Separator
{
StrokeThickness = 1,
StrokeDashArray = new System.Windows.Media.DoubleCollection(2),
Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86))
}
});
cartesianChart1.AxisY.Add(new Axis
{
IsMerged = true,
Separator = new Separator
{
StrokeThickness = 1.5,
StrokeDashArray = new System.Windows.Media.DoubleCollection(4),
Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86))
}
}); }
}
}

LiveCharts文档-3开始-5序列Series的更多相关文章

  1. LiveCharts文档-3开始-3类型和设置

    原文:LiveCharts文档-3开始-3类型和设置 LiveCharts文档-3开始-3类型和设置 类型和设置 这一部分非常的重要,涉及到LiveCharts的基本构成单元的介绍 LiveChart ...

  2. LiveCharts文档-3开始-7标签

    原文:LiveCharts文档-3开始-7标签 LiveCharts文档-3开始-7标签 Label就是Chart中表示数值的字符串,通常被放置在轴的位置和提示当中. 下图中的这些字符串显示的都是标签 ...

  3. LiveCharts文档-3开始-8自定义工具提示

    原文:LiveCharts文档-3开始-8自定义工具提示 LiveCharts文档-3开始-8自定义工具提示 默认每个需要tooltip或者legend的chart都会初始化一个DefaultLeng ...

  4. LiveCharts文档-4基本绘图-1基本线条图

    原文:LiveCharts文档-4基本绘图-1基本线条图 4基本绘图-1基本线条图 using System; using System.Windows.Forms; using System.Win ...

  5. LiveCharts文档-4基本绘图-2基本柱形图

    原文:LiveCharts文档-4基本绘图-2基本柱形图 4基本绘图-2基本柱形图 using System.Windows.Forms; using LiveCharts; using LiveCh ...

  6. LiveCharts文档-3开始-4可用的图表

    原文:LiveCharts文档-3开始-4可用的图表 LiveCharts文档-3开始-4可用的图表 LiveCharts共有5类图表,你将会在后面的章节当中看到这些图表的使用方法. Cartesia ...

  7. LiveCharts文档-3开始-2基础

    原文:LiveCharts文档-3开始-2基础 LiveCharts文档-3开始-2基础 基本使用 LiveCharts设计的很容易使用,所有的东西都可以自动的实现更新和动画,库会在它觉得有必要更新的 ...

  8. LiveCharts文档-4基本绘图-3其他

    原文:LiveCharts文档-4基本绘图-3其他 4基本绘图-3其他 因为每个图表的使用方法大同小异,所以不再啰嗦重复,具体直接看这个链接里的介绍.原文链接 其他的图表类型有 基本堆叠图 基本条形图 ...

  9. LiveCharts文档-3开始-6轴Axes

    原文:LiveCharts文档-3开始-6轴Axes LiveCharts文档-3开始-6轴Axes 通常来说,你可以自定义LiveChart里的任何东西,Axes也不例外.下面这幅图展示了Axes. ...

随机推荐

  1. Landsat8 卫星数据下载

    具体参考    https://www.ixxin.cn/2016/11/27/landsat8freedata/

  2. MySQL数据库导入错误:ERROR 1064 (42000) 和 ERROR at line xx: Unknown command '\Z'.

    使用mysqldump命令导出数据: D:\Program Files\MySQL\MySQL Server 5.6\bin>mysqldump -hlocalhost -uroot -proo ...

  3. Android 震动模式

    震动类 public class VibratorUtil { private static final long DEFAULT_VIBRATOR = 100; private static Vib ...

  4. couldn't locate lint-gradle-api-26.1.2.jar for flutter project

    Could not find com.android.tools.lint:lint-gradle:26.1.2 当我尝试构建发行版本APK 时导致报这种错误,无法发行,针对自己的项目作出了相关修改, ...

  5. VsCode 的使用

    一.简介 VsCode(Visual Studio Code),官网地址:https://code.visualstudio.com/ Visual Studio Code is a lightwei ...

  6. Linux下如何杀死终端

    1.首先是使用who命令查看当前有多少个终端登陆了Linux系统 [root@:vg_adn_tidbCkhsTest /usr/local/redis/bin]#who mobdev pts : ( ...

  7. PHP实现简单下载功能

    PHP实现简单下载 PHP文件为download.php,供下载的文件为1.jpg. <?php $filename="1.jpg"; if(!file_exists($fi ...

  8. Luogu P4705 玩游戏

    题目描述 Alice 和 Bob 又在玩游戏. 对于一次游戏,首先 Alice 获得一个长度为 ​ 的序列 ​,Bob 获得一个长度为 ​ 的序列 bb.之后他们各从自己的序列里随机取出一个数,分别设 ...

  9. python 在windows下的 虚拟环境

    解决 python 环境问题 windows 下安装 pip install virtualenv virtualenv的基本使用 1.1 创建虚拟环境 virtualenv venv 为环境指定Py ...

  10. Android 的窗口管理系统 (View, Canvas, WindowManager)

    http://blog.csdn.net/ritterliu/article/details/39295271 From漫天尘沙 在图解Android - Zygote 和 System Server ...