in microsoft excel, with vba, I can add a fill polygon in a chart, like this
with this data
|1 |2 |
|2 |5 |
|10 |20|
|11 |20|
en this vba code
Sub triangle_scatter()
Dim cht As Chart
Set cht = ActiveSheet.Shapes.AddChart(XlChartType:=xlXYScatterSmoothNoMarkers).Chart
Dim triArray(1 To 4, 1 To 2) As Single
triArray(1, 1) = 25
triArray(1, 2) = 100
triArray(2, 1) = 100
triArray(2, 2) = 150
triArray(3, 1) = 150
triArray(3, 2) = 50
triArray(4, 1) = 25
triArray(4, 2) = 100
With cht
.SetSourceData Source:=Range("A3:B6")
.Shapes.AddPolyline triArray
End With
End Sub
but in this case the triangle is generated with coordinates of plot area, how I can plot with the axis coordinates ?
Aucun commentaire:
Enregistrer un commentaire