Description:
Add zero line and adjust label position.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r641:1ee0ff310392 -

@@ -90,7 +90,11
90 for(int i = 0; i < labels; i++) {
90 for(int i = 0; i < labels; i++) {
91 var value = Scale(range, domain, (int)(vertical ? tick_position.Y : tick_position.X));
91 var value = Scale(range, domain, (int)(vertical ? tick_position.Y : tick_position.X));
92 var label = String.Format("{0}", value);
92 var label = String.Format("{0}", value);
93 draw_list.AddText(font, 11.0f, tick_absolute_position, (uint)ImGuiColor.BLACK, label);
93 var height_adjust = ImGui.CalcTextSize(label).Y / 2;
94 var adjusted_position = Num.Vector2.Add(tick_absolute_position,
95 new Num.Vector2(0, -height_adjust));
96
97 draw_list.AddText(font, 11.0f, adjusted_position, (uint)ImGuiColor.BLACK, label);
94 //Logging.Info(String.Format("Drawing {0:} at {1} ({2})", label, tick_absolute_position, tick_position));
98 //Logging.Info(String.Format("Drawing {0:} at {1} ({2})", label, tick_absolute_position, tick_position));
95
99
96 if (vertical) {
100 if (vertical) {
@@ -202,6 +206,7
202 Num.Vector2.Add(new Num.Vector2(350, 200 - padding), c),
206 Num.Vector2.Add(new Num.Vector2(350, 200 - padding), c),
203 (uint)ImGuiColor.LIGHTGREY, 1.0f);
207 (uint)ImGuiColor.LIGHTGREY, 1.0f);
204
208
209
205 foreach (var key in keys)
210 foreach (var key in keys)
206 {
211 {
207 if (data_sets_show[key] && data_sets[key].Count() > 0)
212 if (data_sets_show[key] && data_sets[key].Count() > 0)
@@ -214,6 +219,13
214 var domain = new Num.Vector2(domain_min, domain_max);
219 var domain = new Num.Vector2(domain_min, domain_max);
215 var range = new Num.Vector2(200 - padding, 0 + padding);
220 var range = new Num.Vector2(200 - padding, 0 + padding);
216
221
222 //Zero
223 var zero_point = Scale(domain, range, 0);
224 Logging.Spy(new {zero_point = zero_point});
225 draw_list.AddLine(Num.Vector2.Add(new Num.Vector2(padding, zero_point), c),
226 Num.Vector2.Add(new Num.Vector2(350, zero_point), c),
227 (uint)ImGuiColor.LIGHTGREY, 1.0f);
228
217 var x_domain = new Num.Vector2((data_sets["Misc"].Count() - (int)periods),
229 var x_domain = new Num.Vector2((data_sets["Misc"].Count() - (int)periods),
218 data_sets["Misc"].Count());
230 data_sets["Misc"].Count());
219 var x_range = new Num.Vector2(0 + padding, 350 - padding);
231 var x_range = new Num.Vector2(0 + padding, 350 - padding);
You need to be logged in to leave comments. Login now