如何在c#图表系列中绘制一个clrcle [英] how to draw a clrcle in c# chart series

查看:87
本文介绍了如何在c#图表系列中绘制一个clrcle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在C#图表中画一个圆圈,让x和y坐标在图表的中心

I want draw a circle in C# chart, and let x and y coordinate in the center of chart

推荐答案

你可以处理图表的PostPaint 事件。在这里,使用 e.Graphics.DrawEllipse 方法,您可以在所需位置绘制圆圈。



我无法测试这个但是恕我直言的图表区域宽度和高度的一半将给出相对于轴的中心坐标。然后,您可以使用上面提到的Graphics对象获取绝对坐标。
You can handle the PostPaint event for the chart. Here, using e.Graphics.DrawEllipse method you can draw the circle at desired location.

I cant test this but IMHO half of the width and height of chart area will give you center coordinates relative to axes. You can then get the absolute coordinates using the Graphics object mentioned above.


这篇关于如何在c#图表系列中绘制一个clrcle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆