This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
/
Form1.vb
88 lines (85 loc) · 3.23 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Imports DevExpress.XtraEditors
Imports DevExpress.XtraTreeMap
Imports System
Imports System.Collections.Generic
Imports System.Drawing
Namespace SunburstFlatDataAdapterSample
Partial Public Class MainForm
Inherits XtraForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub OnLoad(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim dataAdapter As New SunburstFlatDataAdapter()
dataAdapter.ValueDataMember = "Annual"
dataAdapter.LabelDataMember = "Product"
dataAdapter.GroupDataMembers.AddRange(New String() { "Category", "Country" })
dataAdapter.DataSource = CreateProductInfos()
sunburstControl.DataAdapter = dataAdapter
sunburstControl.Colorizer = New SunburstGradientColorizer With { _
.Min = 0.4, _
.Max = 0.9, _
.Palette = Palette.Office2019Palette, _
.GradientColor = Color.White _
}
End Sub
Private Function CreateProductInfos() As List(Of ProductInfo)
Return New List(Of ProductInfo) From { _
New ProductInfo With { _
.Product = "Wheat", _
.Country = "China", _
.Annual = 129770, _
.Category = "Cereals" _
}, _
New ProductInfo With { _
.Product = "Maize", _
.Country = "USA", _
.Annual = 370971, _
.Category = "Cereals" _
}, _
New ProductInfo With { _
.Product = "Rice", _
.Country = "China", _
.Annual = 142864, _
.Category = "Cereals" _
}, _
New ProductInfo With { _
.Product = "Soybean", _
.Country = "USA", _
.Annual = 119533, _
.Category = "Oilseeds" _
}, _
New ProductInfo With { _
.Product = "Protein meals", _
.Country = "China", _
.Annual = 93306, _
.Category = "Oilseeds" _
}, _
New ProductInfo With { _
.Product = "Sugar (tq)", _
.Country = "India", _
.Annual = 26000, _
.Category = "Sugar" _
}, _
New ProductInfo With { _
.Product = "Sugar beet", _
.Country = "Russia", _
.Annual = 49473, _
.Category = "Sugar" _
}, _
New ProductInfo With { _
.Product = "Sugar cane", _
.Country = "India", _
.Annual = 384795, _
.Category = "Sugar" _
}, _
New ProductInfo With { _
.Product = "Milk", _
.Country= "India", _
.Annual = 169320, _
.Category = "Dairy" _
} _
}
End Function
End Class
End Namespace