File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,28 @@ double maxIntervalSize
152
152
interval = nextInterval ;
153
153
}
154
154
}
155
+
156
+ /// <summary>
157
+ /// Adds missing negative signs to axis labels when a custom format is used.
158
+ ///
159
+ /// The axis formatter converts the `double`-parameter to a `TimeSpan` and formats
160
+ /// it with `string.Format`. By default, when no custom format is specified, it adds
161
+ /// the negative sign to negative time spans.
162
+ /// When specifying a custom format, the negative sign is no longer added (only to time
163
+ /// spans; it is still added to other types), so it needs to be additionally added
164
+ /// to the formatted string.
165
+ /// </summary>
166
+ protected override string FormatValueOverride ( double x )
167
+ {
168
+ var format = base . FormatValueOverride ( x ) ;
169
+
170
+ if ( StringFormat != null && x < 0 )
171
+ {
172
+ format = "-" + format ;
173
+ }
174
+
175
+ return format ;
176
+ }
155
177
}
156
178
}
157
179
}
You can’t perform that action at this time.
0 commit comments