vb.net 在VB中创建图形

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19595186/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 15:37:33  来源:igfitidea点击:

Creating graphs in VB

vb.net

提问by Jadeja RJ

I have three listviews in VB.net and i want to get common values from that and make an custom chart from it For Example, Eg.

我在 VB.net 中有三个列表视图,我想从中获取通用值并从中制作自定义图表例如,例如。

Listview1  Listview2  Listview3
A          B          H
B          C          B
C          A          D
D          E          E
E          J          F

Common in Listview

列表视图中常见

1 And 2    2 And 3   1 And 3
A          B         B
B          E         D
C                    E
E

Then Create Graph shown like this Diagram

然后创建像这样显示的图形 图表

I know how to get common values but don't know how to draw graph like this

我知道如何获得通用值但不知道如何绘制这样的图形

Any ideas or Suggestions . . . . .?? It's VB Forms Application

任何想法或建议。. . . .?? 这是 VB 表单应用程序

回答by BRSinh

Try Using Graph#You'll find enough documentation And tutorials there

尝试使用Graph#你会在那里找到足够的文档和教程

回答by Monika

There is a chart tool where you can add your values and plot in various styles

有一个图表工具,您可以在其中添加值并以各种样式绘制

Here's a simple example of creating a line graph with a single series containing 3 data points.

这是一个简单的示例,该示例使用包含 3 个数据点的单个系列创建折线图。

Drag a chart to your form and add this code

将图表拖到您的表单中并添加此代码

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     Chart1.Series.Clear()
     Chart1.Titles.Add("Demo")
     'Create a new series and add data points to it.
     Dim s As New Series
     s.Name = "aline"
     'Change to a line graph.
     s.ChartType = SeriesChartType.Line
     s.Points.AddXY("1990", 27)
     s.Points.AddXY("1991", 15)
     s.Points.AddXY("1992", 17)
     'Add the series to the Chart1 control.
     Chart1.Series.Add(s)
 End Sub

You will need to add

你需要添加

Imports System.Windows.Forms.DataVisualization.Charting

Of course you would have to iterate through your data and add points based on your information.

当然,您必须遍历数据并根据您的信息添加点。