Description:
Put new graph on top.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -185,68 +185,6 | |||||
|
185 | } |
|
185 | } |
|
186 | } |
|
186 | } |
|
187 |
|
187 | ||
|
188 | ImPlot.PushStyleVar(ImPlotStyleVar.LineWeight, 2.0f); |
|
||
|
189 | ImPlot.PushStyleVar(ImPlotStyleVar.MinorAlpha, 0.0f); |
|
||
|
190 |
|
|||
|
191 | ImPlot.SetNextPlotLimits(totals.Count()-periods, totals.Count(), min, max, ImGuiCond.Always); |
|
||
|
192 | if (ImPlot.BeginPlot("My Plot", null, null, new Num.Vector2(-1,0), ImPlotFlags.NoLegend | ImPlotFlags.NoMousePos )) { |
|
||
|
193 | foreach (var key in keys) { |
|
||
|
194 | var show = data_sets_show[key]; |
|
||
|
195 | var data = data_sets[key]; |
|
||
|
196 | var data_array = data_sets[key].ToArray(); |
|
||
|
197 | if (data_array.Length > 0 && show) |
|
||
|
198 | { |
|
||
|
199 | ImPlot.PlotLine(key, ref data_array[0], data_array.Length); |
|
||
|
200 | ImPlot.AnnotateClamped(data_array.Length-1, data_array[data_array.Length-1], |
|
||
|
201 | new Num.Vector2(5, -10), StyleSets.grey, key); |
|
||
|
202 | } |
|
||
|
203 | } |
|
||
|
204 |
|
|||
|
205 | ImPlot.EndPlot(); |
|
||
|
206 | } |
|
||
|
207 |
|
|||
|
208 | ImPlot.PopStyleVar(2); |
|
||
|
209 |
|
|||
|
210 | ImGui.RadioButton("1 year", ref GraphWindow.year, 1); |
|
||
|
211 | ImGui.SameLine(); |
|
||
|
212 | ImGui.RadioButton("5 years", ref GraphWindow.year, 5); |
|
||
|
213 | ImGui.SameLine(); |
|
||
|
214 | ImGui.RadioButton("25 years", ref GraphWindow.year, 25); |
|
||
|
215 | ImGui.SameLine(); |
|
||
|
216 | ImGui.RadioButton("100 years", ref GraphWindow.year, 100); |
|
||
|
217 |
|
|||
|
218 | ImGui.Text("Trees:"); |
|
||
|
219 | for (int i = 0; i < tree_series.Length; i++) |
|
||
|
220 | { |
|
||
|
221 | var key = tree_series[i]; |
|
||
|
222 | if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) |
|
||
|
223 | { |
|
||
|
224 | data_sets_show[key] = !data_sets_show[key]; |
|
||
|
225 | } |
|
||
|
226 |
|
|||
|
227 | if (i != tree_series.Length-1) |
|
||
|
228 | { |
|
||
|
229 | ImGui.SameLine(); |
|
||
|
230 | } |
|
||
|
231 | } |
|
||
|
232 |
|
|||
|
233 | ImGui.Text("Money:"); |
|
||
|
234 | for (int i = 0; i < money_series.Length; i++) |
|
||
|
235 | { |
|
||
|
236 | var key = money_series[i]; |
|
||
|
237 | if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) |
|
||
|
238 | { |
|
||
|
239 | data_sets_show[key] = !data_sets_show[key]; |
|
||
|
240 | } |
|
||
|
241 | if ((i % 4 != 3) && (i != money_series.Length-1)) { |
|
||
|
242 | ImGui.SameLine(); |
|
||
|
243 | } |
|
||
|
244 | } |
|
||
|
245 |
|
|||
|
246 | ImGui.Text("Always show zero:"); |
|
||
|
247 | ImGui.SameLine(); |
|
||
|
248 | ImGui.Checkbox("##AlwaysShowZero", ref always_show_zero); |
|
||
|
249 |
|
|||
|
250 | var draw_list = ImGui.GetWindowDrawList(); |
|
188 | var draw_list = ImGui.GetWindowDrawList(); |
|
251 | var padding = 30; |
|
189 | var padding = 30; |
|
252 |
|
190 | ||
@@ -302,6 +240,71 | |||||
|
302 |
|
240 | ||
|
303 | ImGui.Dummy(new Num.Vector2(350, 200)); |
|
241 | ImGui.Dummy(new Num.Vector2(350, 200)); |
|
304 |
|
242 | ||
|
|
243 | ImGui.RadioButton("1 year", ref GraphWindow.year, 1); | ||
|
|
244 | ImGui.SameLine(); | ||
|
|
245 | ImGui.RadioButton("5 years", ref GraphWindow.year, 5); | ||
|
|
246 | ImGui.SameLine(); | ||
|
|
247 | ImGui.RadioButton("25 years", ref GraphWindow.year, 25); | ||
|
|
248 | ImGui.SameLine(); | ||
|
|
249 | ImGui.RadioButton("100 years", ref GraphWindow.year, 100); | ||
|
|
250 | |||
|
|
251 | ImGui.Text("Trees:"); | ||
|
|
252 | for (int i = 0; i < tree_series.Length; i++) | ||
|
|
253 | { | ||
|
|
254 | var key = tree_series[i]; | ||
|
|
255 | if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) | ||
|
|
256 | { | ||
|
|
257 | data_sets_show[key] = !data_sets_show[key]; | ||
|
|
258 | } | ||
|
|
259 | |||
|
|
260 | if (i != tree_series.Length-1) | ||
|
|
261 | { | ||
|
|
262 | ImGui.SameLine(); | ||
|
|
263 | } | ||
|
|
264 | } | ||
|
|
265 | |||
|
|
266 | ImGui.Text("Money:"); | ||
|
|
267 | for (int i = 0; i < money_series.Length; i++) | ||
|
|
268 | { | ||
|
|
269 | var key = money_series[i]; | ||
|
|
270 | if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) | ||
|
|
271 | { | ||
|
|
272 | data_sets_show[key] = !data_sets_show[key]; | ||
|
|
273 | } | ||
|
|
274 | if ((i % 4 != 3) && (i != money_series.Length-1)) { | ||
|
|
275 | ImGui.SameLine(); | ||
|
|
276 | } | ||
|
|
277 | } | ||
|
|
278 | |||
|
|
279 | ImGui.Text("Always show zero:"); | ||
|
|
280 | ImGui.SameLine(); | ||
|
|
281 | ImGui.Checkbox("##AlwaysShowZero", ref always_show_zero); | ||
|
|
282 | |||
|
|
283 | |||
|
|
284 | #if DEBUG | ||
|
|
285 | ImPlot.PushStyleVar(ImPlotStyleVar.LineWeight, 2.0f); | ||
|
|
286 | ImPlot.PushStyleVar(ImPlotStyleVar.MinorAlpha, 0.0f); | ||
|
|
287 | |||
|
|
288 | ImPlot.SetNextPlotLimits(totals.Count()-periods, totals.Count(), min, max, ImGuiCond.Always); | ||
|
|
289 | if (ImPlot.BeginPlot("My Plot", null, null, new Num.Vector2(-1,0), ImPlotFlags.NoLegend | ImPlotFlags.NoMousePos )) { | ||
|
|
290 | foreach (var key in keys) { | ||
|
|
291 | var show = data_sets_show[key]; | ||
|
|
292 | var data = data_sets[key]; | ||
|
|
293 | var data_array = data_sets[key].ToArray(); | ||
|
|
294 | if (data_array.Length > 0 && show) | ||
|
|
295 | { | ||
|
|
296 | ImPlot.PlotLine(key, ref data_array[0], data_array.Length); | ||
|
|
297 | ImPlot.AnnotateClamped(data_array.Length-1, data_array[data_array.Length-1], | ||
|
|
298 | new Num.Vector2(5, -10), StyleSets.grey, key); | ||
|
|
299 | } | ||
|
|
300 | } | ||
|
|
301 | |||
|
|
302 | ImPlot.EndPlot(); | ||
|
|
303 | } | ||
|
|
304 | |||
|
|
305 | ImPlot.PopStyleVar(2); | ||
|
|
306 | #endif | ||
|
|
307 | |||
|
305 | ImGui.End(); |
|
308 | ImGui.End(); |
|
306 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; |
|
309 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; |
|
307 | StyleSets.defaultSet.pop(); |
|
310 | StyleSets.defaultSet.pop(); |
You need to be logged in to leave comments.
Login now