https://stackoverflow.com/questions/12422398/drawing-line-on-a-click-on-zedgraph-pane

public Form1()
{
InitializeComponent();
} PointPairList userClickrList = new PointPairList();
LineItem userClickCurve = new LineItem("userClickCurve"); private void zedGraphControl1_MouseClick(object sender, MouseEventArgs e)
{
// Create an instance of Graph Pane
GraphPane myPane = zedGraphControl1.GraphPane; // x & y variables to store the axis values
double xVal;
double yVal; // Clear the previous values if any
userClickrList.Clear(); myPane.Legend.IsVisible = false; // Use the current mouse locations to get the corresponding
// X & Y CO-Ordinates
myPane.ReverseTransform(e.Location, out xVal, out yVal); // Create a list using the above x & y values
userClickrList.Add(xVal, myPane.YAxis.Scale.Max);
userClickrList.Add(xVal, myPane.YAxis.Scale.Min); // Add a curve
userClickCurve = myPane.AddCurve(" ", userClickrList, Color.Red, SymbolType.None); zedGraphControl1.Refresh();
}

you just have to change the userClickList to draw horizontal line.

Drawing line on a click on ZedGraph Pane的更多相关文章

  1. LightOJ 1285 - Drawing Simple Polygon (几何,极角排序)

    1285 - Drawing Simple Polygon   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: ...

  2. Xcode 8.X Command Line Tools

    Summary Step 1. Upgrade Your System to macOS Sierra Step 2. Open the Terminal Application Step 3. Is ...

  3. C#图表控件ZedGraph使用

    最近从java转到C#下开发PC端的桌面程序,之前也尝试用java GUI写桌面程序,发现java写桌面程序还是诸多不便变,虽然最后也写出来了,但是决心还是另起平台,有了一定的java基础,来学习C# ...

  4. Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException

    记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...

  5. Java基础之扩展GUI——高亮元素、上下文菜单、移动旋转元素、自定义颜色(Sketcher 10)

    窗口应用程序. 本例在上一版的基础上实现了高亮元素.移动元素.上下文菜单.旋转元素.设置自定义颜色. 1.自定义常量包: // Defines application wide constants p ...

  6. Java基础之扩展GUI——添加状态栏(Sketcher 1 with a status bar)

    控制台程序. 为了显示各个应用程序参数的状态,并且将各个参数显示在各自的面板中,在应用程序窗口的底部添加状态栏是常见且非常方便的方式. 定义状态栏时没有Swing类可用,所以必须自己建立StatusB ...

  7. ChartControl第一课简短的控件初步设计

    WinForms Controls >Controls > Chart Control > Getting Started This document gives you a qui ...

  8. ObjectARX® for Beginners: An Introduction

    转:ObjectARX® for Beginners: An Introduction Lee Ambrosius – Autodesk, Inc.         CP4164-L    Objec ...

  9. [翻译] PNChart

    PNChart https://github.com/kevinzhow/PNChart You can also find swift version at here https://github. ...

随机推荐

  1. PYTHON-模块定义 搜索路径

    模块是什么: ***** 模块 是一系列功能的集合体 一个py文件就是一个模块 一个函数就是一个功能 例如 A.py 文件名A.py 模块名 A 模块有哪些来源 内置 第三方 自定义 模块有四种通用的 ...

  2. 【ES】学习6-多字段搜索1

    本系列的笔记都来自:https://elasticsearch.cn/book/elasticsearch_definitive_guide_2.x/multi-field-search.html 下 ...

  3. laravel 集合

    最近一直在用laravel框架,比较喜欢laravel的ORM(通常我们理解的Model)...但是默认情况下,Eloquent 查询的结果总是返回 Collection 实例...所有不得不了解co ...

  4. String:(字符串)中常用的方法

    package stringyiwen; //字符串中常用的方法public class StringTest03 { public static void main(String[] args) { ...

  5. 基于bootstrap的基本模板

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

  6. centos java tomcat 中文乱码解决办法

    现象: cenos 部署java web 程序 ,java类中有中文 出现乱码现象 即使使用: System.getProperty("中文") 控制台都出现  ??????  乱 ...

  7. 设计原则:开-闭原则(Open-Closed Principle, OCP)

    开-闭原则就是软件实体应当对扩展开放,对修改关闭.(Software entities should be open for extension,but closed for modification ...

  8. Hibernate的核心对象关系映射

    Hibernate的核心就是对象关系映射: 加载映射文件的两种方式: 第一种:<mapping resource="com/bie/lesson02/crud/po/employee. ...

  9. gulp给文件加版本号

    版本号用文件MD5生成 默认根据文件MD5生成,因此文件未发生改变,此版本号将不会变 所以当没有改变文件的时候,我们就不能用gulp来改变版本号了 需要安装的插件 npm install --save ...

  10. ctsc2018

    day1: 8:20分还不知道考场在哪给ccf差评 8:30开始看题 第一题感觉是个模拟啊 很烦 瞄了一眼第二题第三题题意挺简单的啊感觉还不错 然后开始仔细看t1 然后我发现好像可以退狮子 应该是个数 ...