最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

在 Visual Studio 中制作 4 边图形4 边(笛卡尔)网格

SEO心得admin65浏览0评论
本文介绍了在 Visual Studio 中制作 4 边图形/4 边(笛卡尔)网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在尝试制作一个可以显示和连接我设置的点的 4 边图/4 边网格

I've been trying to make a 4 sided graph / 4 sided grid that can show and connect points that I set

但是在工具箱中使用图表不起作用,因为我找不到那种类型的图表.我怎样才能制作一个?

However using the Chart in the toolbox did not work as I couldn't find that type of a graph. How can I make one?

示例图:

推荐答案

这很简单.您需要做的就是告诉 Chart 将 Axis 的 Crossing 放置在某些点,而不是保持未设置(NaN).

This is quite simple. All you need to do is tell the Chart to place the Crossing of the Axis at certain points, instead of keeping it unset (NaN).

您还应该通过设置Minimum 和Maximum 来设置范围:

You also should set the range by setting Minimum and Maximum:

ChartArea CA = chart1.ChartAreas[0]; Series S1 = chart1.Series[0]; S1.ChartType = SeriesChartType.Line; CA.AxisX.Maximum = 100; CA.AxisX.Minimum = -100; CA.AxisY.Maximum = 100; CA.AxisY.Minimum = -100; CA.AxisX.Crossing = 0; CA.AxisY.Crossing = 0; CA.AxisX.Interval = 10; CA.AxisY.Interval = 10; CA.AxisX.LineWidth = 3; CA.AxisY.LineWidth = 3; CA.AxisX.MajorGrid.Enabled = false; CA.AxisY.MajorGrid.Enabled = false; CA.AxisX.MinorTickMark.Enabled = false; CA.AxisY.MinorTickMark.Enabled = false; // now we add a few points: S1.Points.AddXY(-21,81); S1.Points.AddXY(52,60); S1.Points.AddXY(-53, -11); S1.Points.AddXY(-53, 88);

您可以使用大多数图表类型,但不是全部,例如 Pie.

You can use most chart types, though not all, like Pie.

您可以使用许多其他属性来让它按您的意愿工作;尤其是 Interval 可能很有趣!

You can play around with many other properties to make it work as you want; especially the Interval may be of interest!

其他感兴趣的属性包括:

Other properies of interest include these:

CA.AxisX.ArrowStyle = AxisArrowStyle.Triangle; CA.AxisX.MinorTickMark.Enabled = false; CA.AxisX.LabelStyle.Enabled = false;
发布评论

评论列表(0)

  1. 暂无评论