Drawing line on a click on ZedGraph Pane
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的更多相关文章
- LightOJ 1285 - Drawing Simple Polygon (几何,极角排序)
1285 - Drawing Simple Polygon PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: ...
- Xcode 8.X Command Line Tools
Summary Step 1. Upgrade Your System to macOS Sierra Step 2. Open the Terminal Application Step 3. Is ...
- C#图表控件ZedGraph使用
最近从java转到C#下开发PC端的桌面程序,之前也尝试用java GUI写桌面程序,发现java写桌面程序还是诸多不便变,虽然最后也写出来了,但是决心还是另起平台,有了一定的java基础,来学习C# ...
- Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException
记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...
- Java基础之扩展GUI——高亮元素、上下文菜单、移动旋转元素、自定义颜色(Sketcher 10)
窗口应用程序. 本例在上一版的基础上实现了高亮元素.移动元素.上下文菜单.旋转元素.设置自定义颜色. 1.自定义常量包: // Defines application wide constants p ...
- Java基础之扩展GUI——添加状态栏(Sketcher 1 with a status bar)
控制台程序. 为了显示各个应用程序参数的状态,并且将各个参数显示在各自的面板中,在应用程序窗口的底部添加状态栏是常见且非常方便的方式. 定义状态栏时没有Swing类可用,所以必须自己建立StatusB ...
- ChartControl第一课简短的控件初步设计
WinForms Controls >Controls > Chart Control > Getting Started This document gives you a qui ...
- ObjectARX® for Beginners: An Introduction
转:ObjectARX® for Beginners: An Introduction Lee Ambrosius – Autodesk, Inc. CP4164-L Objec ...
- [翻译] PNChart
PNChart https://github.com/kevinzhow/PNChart You can also find swift version at here https://github. ...
随机推荐
- 笔记 oracle 创建联合主键
笔记 alter table tablename add constraint unionkeyname primary key (column1,column2); 上面语句中: tablename ...
- Intellij IDEA配置tomcat热部署
idea2017+tomcat8为本文的实验环境 1.打开tomcat的edit configuration,一定要选择war exploded 在idea tomcat 中server的配置里,有 ...
- 对象奔驰E2000
<script> window.onload = function (ev) { // 调用对象前先创建 // 2 var vcar=new Car("奔驰",&quo ...
- hdu 1004 颜色与数字(map水题)
Sample Input5 //Tgreenredblueredred 统计颜色的次数 输出最多的颜色3pinkorangepink0 Sample Outputred pink # include ...
- Android Studio之导出JavaDoc出现编码GBK的不可映射字符
使用Android Studio导出JavaDoc时,如果在注释中添加了中文,生成时的时候会出现错误: 编码GBK的不可映射字符. 解决的办法是在Other command line argument ...
- Delphi数据库数据用文件流方式快速写入Excel文件
在开发数据库应用程序中,经常要将类型相同的数据导出来,放到Excel文件中,利用Excel强大的编辑功能,对数据作进一步的加工处理.这有许多的方法,我们可以使用OLE技术,在Delphi中创建一个自动 ...
- tomcat启动慢解决方案
一.环境 centos6.7 tomcat8 jdk1.8 二.现象 启动tomcat会花费10多分钟,正常情况下几秒就可以了. 三.解决办法 度娘了一下是因为jdk在生成随机数上耗时,找到j ...
- jenkins X实践系列(2) —— 基于jx的DevOps实践
jx是云原生CICD,devops的一个最佳实践之一,目前在快速的发展成熟中.最近调研了JX,这里为第2篇,使用已经安装好的jx来实践CICD,旨在让大家了解基于jx的DevOps是如何运转的,感兴趣 ...
- python错误、调试、测试
1.错误, Python内置的try...except...finally用来处理错误十分方便.出错时,会分析错误信息并定位错误发生的代码位置才是最关键的. 程序也可以主动抛出错误,让调用者来处理相应 ...
- 敌兵布阵 HDU1166
基础线段树 #include<cstdio> #include<iostream> using namespace std; int n,p,a,b,m,x,y,ans; st ...