Description:
Handle the chosen range.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r615:f09301fe0a74 -

@@ -66,10 +66,7
66 points[i] = Num.Vector2.Add(points[i], c);
66 points[i] = Num.Vector2.Add(points[i], c);
67 }
67 }
68
68
69 // uint col = 0b_1111_1111_1111_0000;
69 draw_list.AddPolyline(ref points[0], points.Length, col, 0 /*ImDrawFlags.RoundCornersDefault*/, 1.0f);
70 // uint col = 0xFF000000;
71
72 draw_list.AddPolyline(ref points[0], points.Length, col, ImDrawFlags.RoundCornersDefault, 1.0f);
73 }
70 }
74
71
75 public static int Scale(Num.Vector2 domain, Num.Vector2 range, int num) {
72 public static int Scale(Num.Vector2 domain, Num.Vector2 range, int num) {
@@ -224,8 +221,12
224
221
225 var padding = 10;
222 var padding = 10;
226
223
224 var domain = new Num.Vector2(domain_min, domain_max);
227 var range = new Num.Vector2(200 - padding, 0 + padding);
225 var range = new Num.Vector2(200 - padding, 0 + padding);
228 var domain = new Num.Vector2(domain_min, domain_max);
226
227 var x_domain = new Num.Vector2((data_sets["Misc"].Count() - (int)periods),
228 data_sets["Misc"].Count());
229 var x_range = new Num.Vector2(0 + padding, 350 - padding);
229
230
230 foreach (var key in keys)
231 foreach (var key in keys)
231 {
232 {
@@ -236,13 +237,14
236 if (data.Count() > 0 && show)
237 if (data.Count() > 0 && show)
237 {
238 {
238 IEnumerable<int> data_array = data_sets[key].Select((p) => Scale(domain, range, (int)p));
239 IEnumerable<int> data_array = data_sets[key].Select((p) => Scale(domain, range, (int)p));
239 var data_array2 = data_array.Select((p, i) => new Num.Vector2(i * 10 + padding, p)).ToArray();
240 var data_array2 = data_array.Select((p, i) => new Num.Vector2(Scale(x_domain, x_range, i), p)).ToArray();
241
240 DrawLine(draw_list, data_array2, color);
242 DrawLine(draw_list, data_array2, color);
241 draw_list.AddText(data_array2.Last(), color, key);
243 draw_list.AddText(font, 12, data_array2.Last(), color, key);
242 }
244 }
243 }
245 }
244
246
245 ImGui.Dummy(new Num.Vector2(200, 200));
247 ImGui.Dummy(new Num.Vector2(350, 200));
246
248
247 ImGui.End();
249 ImGui.End();
248 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
250 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
You need to be logged in to leave comments. Login now