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. IO流(2)创建文件或文件夹

    创建功能: *public boolean createNewFile():创建文件 如果存在这样的文件,就不创建了 *public boolean mkdir():创建文件夹 如果存在这样的文件夹, ...

  2. 001-windows下Elasticsearch安装、Elasticsearch-header安装

    一.window安装Elasticsearch安装 elasticsearch的客户端版本必须与服务端版本主版本保持一致. 1.java安装[略] 2.elasticsearch下载 地址:https ...

  3. ubuntu 磁盘分区

    1:查看分区情况:df -h admin@iZwz92c0zpe8t65qe996ckZ:/$ df -h Filesystem Size Used Avail Use% Mounted on ude ...

  4. There are 2 missing blocks. The following files may be corrupted

    There are 2 missing blocks. The following files may be corrupted: 步骤1,检查文件缺失情况 可以看到, blk_1074785806 ...

  5. Gcc ------ gcc的使用简介与命令行参数说明

    gcc的使用简介与命令行参数说明 2011年06月19日 20:29:00 阅读数:10221 2011-06-19 wcdj 参考:<GNU gcc嵌入式系统开发 作者:董文军> (一) ...

  6. PAT 1032 Sharing[hash][链表][一般上]

    1032 Sharing (25)(25 分) To store English words, one method is to use linked lists and store a word l ...

  7. Keepalived+HAproxy实现高可用负载均衡

    总概:       Keepalived是一个类似于layer3, 4 & 5交换机制的软件,也就是我们平时说的第3层.第4层和第5层交换.Keepalived的作用是检测web服务器的状态, ...

  8. Sublime text 3搭建Python-Anaconda开发环境

    网络上的教程各种各样,大同小异.自己安装时还是出了些问题,因此总结一篇博文. Sublime Text 是一款轻量级跨平台的文本编辑器,可通过包(Package)扩充自身功能. 有很多搭建python ...

  9. jmeter 逻辑控制器Logic Controller详解

    Jmeter之逻辑控制器(Logic Controller) 前言: 1. Jmeter官网对逻辑控制器的解释是:“Logic Controllers determine the order in w ...

  10. HDU 1700 Points on Cycle (几何 向量旋转)

    http://acm.hdu.edu.cn/showproblem.php?pid=1700 题目大意: 二维平面,一个圆的圆心在原点上.给定圆上的一点A,求另外两点B,C,B.C在圆上,并且三角形A ...