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. STM32F412应用开发笔记之十:多组分气体分析仪设计验证

    本次将NUCLEO-F412ZG应用于我们的多组分气体分析仪的实现试验,从整体上测试实际项目的应用情况. 一.项目概述 多组分气体分析仪是我公司近期研发的三个主要产品之一.采用模块化设计,可增减配置, ...

  2. STM32应用实例五:与SHT1X温湿度传感器通讯

    在这次项目开发中应用到了SHT1X温湿度传感器,该系列有SHT10.SHT11和SHT15,属于Sersirion温湿度传感器家族中的贴片封装系列.包括一个电容性聚合体测湿敏感元件.一个用能隙材料制成 ...

  3. layui上传文件配合进度条

    首先看一下效果图: 修改layui的源文件upload.js 1.打开layui/modules/upload.js 2.搜索ajax 3.找到url: 4.添加以下代码: ,xhr:l.xhr(fu ...

  4. 【ES】学习1-入门使用

    参考资料: https://elasticsearch.cn/book/elasticsearch_definitive_guide_2.x/_search_lite.htm 1.查询es数据的方法 ...

  5. hdu2888 二维ST表(RMQ)

    二维RMQ其实和一维差不太多,但是dp时要用四维 /* 二维rmq */ #include<iostream> #include<cstring> #include<cs ...

  6. JavaScript中的短路

    短路:逻辑运算从左到右.逻辑或运算,当左边的条件成立时,后面的条件将不再参与运算. 因此在逻辑或运算中,尽量将条件结果为true的放第一位.而在逻辑与运算中,尽量将条件结果为false的放到第一位. ...

  7. jenkins X实践系列(2) —— 基于jx的DevOps实践

    jx是云原生CICD,devops的一个最佳实践之一,目前在快速的发展成熟中.最近调研了JX,这里为第2篇,使用已经安装好的jx来实践CICD,旨在让大家了解基于jx的DevOps是如何运转的,感兴趣 ...

  8. python ThreadLocal

    ThreadLocal: 主要是为了解决各个线程引用全局变量,并且各个线程之间互不影响而设置的. 实例: import threading threadlocal = threading.local( ...

  9. 利用python将表格中的汉字转化为拼音

    缺少包时用pip install 进行安装,例如: pip install xlsxwriter   完成代码如下: #!/usr/bin/python #-*-coding:utf-8-*- #fr ...

  10. scanf清除缓存区

    为什么需要清除scanf缓存区呢?看一个例子: int main() { int a,b; scanf("%d",&a); scanf("%d",&am ...