public TreemapItem AddItem(TreemapData data, Geometric.Point center, double radius) { TreemapItem item = new TreemapItem(center.X - radius, center.Y - radius, 2 * radius, 2 * radius) { Indexes = data.Indexes, Size = data.Size, Color = data.Color }; Items.Add(item); return item; }
private void SetTreemapData() { Data = new List<TreemapData>(); for (int i = 0; i < Sizes.Count; i++) { TreemapData data = new TreemapData(); foreach (var index in Indexes) data.Indexes.Add(index[i]); data.Size = Math.Max(Sizes[i], 0); data.Color = Colors[i]; Data.Add(data); } Data = Data.OrderByDescending(d => d.Size).ToList(); }