根据大量数据批量生成折线图,以下代码为根据不同proj_name与region,绘制以时间为横坐标,size为纵坐标,不同种类数据的折线图。
iRows = ActiveSheet.UsedRange.Rows.Count
proj_name_first = ""
region_first = ""
firsti = 2
For i = 2 To iRows+1
proj_name = Cells(i, 5).Value
region = Cells(i, 6).Value
If proj_name_first <> proj_name or region_first <> region Then
proj_name_first = proj_name
region_first = region
lasti = i - 1
If lasti > firsti Then
n = 0
firstj = firsti
For j = firsti + 1 To lasti + 1