ZedGraph的在线文档

http://zedgraph.sourceforge.net/documentation/default.html

官网的源代码 http://sourceforge.net/projects/zedgraph/?source=directory

zedgraph的demo在线范例

http://zedgraph.sourceforge.net/samples.html

这里介绍了如何实现动态加载数据,并且提供了demo

http://goorman.free.fr/ZedGraph/zedgraph.org/wiki/index3061.html?title=Display_Dynamic_or_Real-Time_Data

The ZedGraphControl can display dynamic or static data. For dynamic displays, each time you want to add data to a graph, you will need to do the following:

ZedGraph可以显示动态或者静态的数据,对于动态展示,每当你想要把数据加载到graph上的时候,你需要按照以下的步骤来做

1.Find the CurveItem of interest within the GraphPane.CurveList collection

第一步,先找到GraphPane.CurveList 中的相关曲线
2.Access the PointPairList (or other IPointListEdit type) for the CurveItem, and add the new data or modify the existing data as required

第二步,找到曲线中的PointPairList ,然后根据需要加载新数据或者修改已经存在的数据
3.Call ZedGraphControl.AxisChange() to update the auto-scaled axis ranges

第三步,调用ZedGraphControl的AxisChange()函数来更新坐标轴范围的比例
4.Call Form.Invalidate() to update the graph

第四步,调用Form.Invalidate() 来更新graph------------[貌似我没有找到这个方法,winform支持?]

The data points are stored with each CurveItem as a reference to an IPointList interface in CurveItem.Points. Note that this point list reference can be any class that implements IPointList. If it also implements IPointListEdit, thenIPointListEdit.Add() and IPointListEdit.RemoveAt() methods will be available.

The code sample is for a form that implements a ZedGraphControl with a Timer event to show dynamically updated data. You can download the complete project from the links below:

ZedGraph控件随机生成曲线的颜色,以及X轴坐标文字竖着显示==========mypane.XAxis.Scale.FontSpec.Angle = 270;//X轴的时间垂直显示

http://blog.csdn.net/happy09li/article/details/7535388

ZedGraph使用大全http://www.cnblogs.com/peterzb/archive/2009/07/19/1526726.html

//zedgraph一些属性的介绍

http://blog.chinaunix.net/uid-20776117-id-1847015.html

ZedGraph刷新数据的方法

zedGraphControl1.AxisChange();//此方法   调整坐标轴的范围

Invalidate()//使控件的特定区域无效并向控件发送绘制消息。

//调用 Invalidate 方法并不强制同步绘制;若要强制同步绘制,请在调用 Invalidate 方法之后调用 Update 方法。 在不带参数的情况下调用此方法时,会将整个工作区添加到更新区域。

zedGraphControl1.Invalidate();
zedGraphControl1.Update();

或者

zedGraphControl1.Refresh();//强制控件使其工作区无效并立即重绘自己和任何子控件。

//让坐标轴不不显示10^x;[这样做会导致比例尺失调]

zedGraphControl1.GraphPane.XAxis.Type = AxisType.Log;

zedGraphControl1.GraphPane.XAxis.Scale.IsUseTenPower = false;

IsUseTenPower ->> 是否为10次幂表示,scale为LogScale时有效。 The powers-of-ten notation is just the text "10" followed by a superscripted value indicating the magnitude. This mode is only valid for log scales. boolean value; true to show the title as a power of ten, false to show a regular numeric value (e.g., "0.01", "10", "1000")

zedGraphControl1.GraphPane.XAxis.Title.IsOmitMag

true to show the magnitude value, false to hide it .   //IsOmitMag为true的时候,显示数量级,为false的时候,不显示
For large scale values, a "magnitude" value (power of 10) is automatically used for scaling the graph. This magnitude value is automatically appended to the end of the Axis Title (e.g., "(10^4)") to indicate that a magnitude is in use. This property controls whether or not the magnitude is included in the title. Note that it only affects the axis title; a magnitude value may still be used even if it is not shown in the title. 
对于大数量级,10幂,会自动显示;数量级会自动加载坐标的Title后面,无论IsOmitMag是true还是false;它仅仅是影响Title,数量级还是正常的影响坐标系的。
 
 
以加载100万数据为例子,说明上面几个的属性
默认状态下的加载界面
 zedGraphControl1.GraphPane.XAxis.Title.IsOmitMag 此属性默认为false,X轴的标题显示10的幂
将zedGraphControl1.GraphPane.XAxis.Title.IsOmitMag 设置为true的时候,就不显示10的幂了
 
 
 
zedGraphControl1.GraphPane.XAxis.Type = AxisType.Log;//横轴按照10的幂为步长//默认横轴是按照10的幂来显示的
 
zedGraphControl1.GraphPane.XAxis.Type = AxisType.Log;
zedGraphControl1.GraphPane.XAxis.Scale.IsUseTenPower = false;//横轴不显示成10的幂

给某一个曲线加载100万点,希望横轴显示100000,200000,300000

直接设定好,坐标轴

zedGraphControl1.GraphPane.XAxis.Scale.Max = number;//设定X轴的最大值
zedGraphControl1.GraphPane.XAxis.Scale.MajorStep = number / 10;//设定最大步长
zedGraphControl1.GraphPane.XAxis.Scale.MinorStep = number / 10 / 5;//设定最小步长
zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Angle = 45;//设定X轴的字体的倾斜度

注意:一定不要调用zedGraphControl1.AxisChange();否则上面的设置就白设置了,相当于重置了

ZedGraph如何动态的加载曲线的更多相关文章

  1. Canvas制作动态进度加载水球

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. Java_动态重新加载Class总结

    在此记载Java动态重新加载Class的点点滴滴,实现之前也在网上看了很多文章,但发现不是很清晰,后来发现总结,看源码实现还是最靠谱. 直接上代码: package com.lkb.autoCode. ...

  3. Java_动态重新加载Class机制

    Java动态重新加载Class 项目中使用到了动态重新加载Class的机制,作用是让一些代码上线之前可以在线上环境测试一下,当然,这是非常不好的测试机制,我刚来的时候也为这种机制感到惊讶—怎么可以在线 ...

  4. Android系统下的动态Dex加载

    1 问题在Android系统中,一个App的所有代码都在一个Dex文件里面.Dex是一个类似Jar的存储了多有Java编译字节码的归档文件.因为Android系统使用Dalvik虚拟机,所以需要把使用 ...

  5. Android系统下的动态Dex加载与app速度优化

    1 问题 在Android系统中,一个App的所有代码都在一个Dex文件里面.Dex是一个类似Jar的存储了多有Java编译字节码的归档文件.因为Android系统使用Dalvik虚拟机,所以需要把 ...

  6. linux动态库加载RPATH, RUNPATH

    摘自http://gotowqj.iteye.com/blog/1926771 linux动态库加载RPATH, RUNPATH 链接动态库 如何程序在连接时使用了共享库,就必须在运行的时候能够找到共 ...

  7. 使用javassist运行时动态重新加载java类及其他替换选择

    在不少的情况下,我们需要对生产中的系统进行问题排查,但是又不能重启应用,java应用不同于数据库的存储过程,至少到目前为止,还不能原生的支持随时进行编译替换,从这种角度来说,数据库比java的动态性要 ...

  8. esri-leaflet入门教程(5)- 动态要素加载

    esri-leaflet入门教程(5)- 动态要素加载 by 李远祥 在上一章节中已经说明了esr-leaflet是如何加载ArcGIS Server提供的各种服务,这些都是服务本身来决定的,API脚 ...

  9. 【微信小程序】模仿58同城页面制作以及动态数据加载

    完成动态数据的加载,如下 使用上班的空余时间慢慢的学习,相信总有一天我会很熟悉的掌握这门技术. 本次学习小总结: 微信小程序使用的代码基本与HTML.CSS.JS等前段有关知识一样. 微信小程序js使 ...

随机推荐

  1. LeetCode 第 338 题 (Counting Bits)

    Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the ...

  2. Javascript异步执行时要小心的变量作用域

    function asyncFunction(callback){ setTimeout(function(){ callback() },200); } var color = 'blue'; // ...

  3. post方式提交数据

    <!DOCTYPE HTML><html>    <head>        <meta charset="utf-8" />   ...

  4. iOS连续上传多张图片

    参考地址:http://www.cocoachina.com/ios/20180730/24366.html 需求是怎样的:for 循环里面.多个网络请求上传图片,每次上传一张,至于为什么每次只上传一 ...

  5. centos 基础修改文件权限

    在centos 下 nginx 默认用户是user = apachegroup = apache 所以需要更改文件和文件夹权限时候需要满足apache用户才能进行 常用方式: $ chmod Runt ...

  6. [py]access日志入mysql-通过flask前端展示

    目录 pymysql组装sql入库日志 代码组织 将入库的日志通过flask前端展示 pymysql组装sql入库日志 pymysql模块的用法 采集这些指标(metirc)都是linux环境,会用到 ...

  7. [py]类和实例方法/内建方法

    内建方法 dir(__builtins__) 类和实例方法对比 class person: def __init__(self, job): self.job = job name = "m ...

  8. Andrew Ng-ML-第八章-正则化

    1.过度拟合overfitting 过度拟合,因为有太多的特征+过少的训练数据,学习到的假设可能很适应训练集,但是不能泛化到新的样例.即泛化generalize能力差. 解决办法: 1.手动/使用选择 ...

  9. C++声明和定义

    目录 1 参考 2 概念 2.1 声明 2.2 定义 3 对比 3.1 声明但不是定义的情况 3.2 声明且是定义的情况 3.3 特殊情况 1. 参考 1. <C++程序设计语言>4.9 ...

  10. 【Java】系统漏洞:关于用户登录后操作的注意事项

    项目背景: SpringMVC + Mybatis  + MySql数据库(javaWeb项目开发) 相关模块:登录,个人详细信息修改,订单详情查询 相关漏洞介绍: 1.登录的验证码:登录的验证码一定 ...