简体   繁体   English

如何在Visual Studio中创建折线图?

[英]How do I create a line chart in visual studio?

I want to create a line chart in visual studio as shown in the picture in Excel below: 我想在Visual Studio中创建折线图,如以下Excel中的图片所示:

折线表

Before I went to Visual Studio, I tried to create a table in Microsoft access as shown in the picture below, but I am still not sure of the steps to create a chart in visual basic: 在进入Visual Studio之前,我试图在Microsoft Access中创建一个表格,如下图所示,但是我仍然不确定在Visual Basic中创建图表的步骤:

在此处输入图片说明

Then, in visual studio, I continued by adding a report viewer and DataGridView. 然后,在Visual Studio中,我继续添加报表查看器和DataGridView。 In the picture shown below you can see my Form1 interface: 在下面显示的图片中,您可以看到我的Form1界面:

表格和报表查看器

Here are the settings in my report chart: 这是我的报告图表中的设置: 在此处输入图片说明

However the result produces this: 但是结果产生了这一点: 在此处输入图片说明

Here's the code : 这是代码:

Public Class Form1

Private Sub Table1BindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles Table1BindingNavigatorSaveItem.Click
    Me.Validate()
    Me.Table1BindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me._5DataSet)

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the '_5DataSet.Table1' table. You can move, or remove it, as needed.
    Me.Table1TableAdapter.Fill(Me._5DataSet.Table1)

    Me.ReportViewer1.RefreshReport()

End Sub

Private Sub Chart1_Click(sender As Object, e As EventArgs)

End Sub

Private Sub ReportViewer1_Load(sender As Object, e As EventArgs) Handles ReportViewer1.Load

End Sub
End Class

My question is, how do I make change this so that the x-axis shows the values 1 to 24 with all the values in the chart the same as my plot in excel? 我的问题是,如何进行更改以使x轴显示值1到24,而图表中的所有值都与excel中的图相同?

对于报告图表中的设置,我建议将OLD和LimitPower移至图表数据的“值”部分,并将时间移至系列组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM