使用VB.net在Excel中绘制折线图

问题描述:

我已经编写了用于在Excel工作表中存储数据的代码,然后使用相同的数据生成了图形.以下是数据:

I have written code for storing data in an Excel worksheet and then I have generated a graph using the same data. The following is the data:

Date        MaxValue    MinValue
12/29/2010  8:21:29     6:00:32
12/30/2010  4:39:36     4:39:36
1/4/2011    6:37:51     6:37:51


现在,我想绘制一个折线图,以日期"作为我的x轴,以最大值"作为系列"之一,最小值"作为其他系列.


Now I want to draw a line graph with the Date as my x-Axis and max value as one of the Series and Min Value as other series.

转到图表向导,然后选择线.出现源数据"对话框时,删除Series3.

对于系列1,将值"更改为MaxValue列(= Sheet1!R2C2:R4C2),将类别(X)"轴标签(底部字段)更改为日期"列(= Sheet1!R2C1:R4C1).
对于系列2,请对MinValue执行相同操作.

确保在名称"字段中添加其名称.

更新:嗯,我只在主题上错过了VB.net.

尝试 [
Go to Chart Wizard and select the line. Delete Series 3 when the Source Data dialog comes up.

For Series 1, change Values to the MaxValue column (=Sheet1!R2C2:R4C2) and The Category (X) axis labels (bottom field) to the Date column (=Sheet1!R2C1:R4C1).

For Series 2, do the same with MinValue.

Make sure to add their names in the Name field.

UPDATE: Hmmm, I missed the VB.net in the subject only.

Try this[^].