Ejemplo n.º 1
0
        private void onObjectHotTracked(HotTrackEventArgs e)
        {
            var series = e.Series();
            var point  = e.HitInfo.SeriesPoint;

            if (series == null || point == null || !point.Values.Any())
            {
                hideToolTip(e);
                return;
            }

            var value     = point.Values[0];
            var intValue  = Math.Ceiling(point.Values[0]);
            var valueText = _doubleFormatter.Format(point.Values[0]);

            if (value == intValue)
            {
                valueText = _intFormatter.Format(Convert.ToInt32(intValue));
            }

            var superToolTip = _toolTipCreator.CreateToolTip($"{AxisY.Title.Text}: {valueText}", series.Name);
            var args         = new ToolTipControllerShowEventArgs {
                SuperTip = superToolTip
            };

            ToolTipController.ShowHint(args);
        }
 private void OnProgressBarCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     try
     {
         if (e.Value == DBNull.Value || e.Value == null)
         {
             e.DisplayText = string.Empty;
         }
         else
         {
             //divide by 100 again to ensure that we show values formatted between 0 and 1
             e.DisplayText = _doubleFormatter.Format(((double)e.Value) / 100);
         }
     }
     catch (Exception)
     {
     }
 }
 private string format(double baseValue, FixedLimitsGroupingDefinition groupingDefinition)
 {
     return(_doubleFormatter.Format(groupingDefinition.ConvertToDisplayUnit(baseValue), groupingDefinition.DisplayUnit.Name));
 }
Ejemplo n.º 4
0
 public string Format(ValueDTO valueDTO)
 {
     return(_doubleFormatter.Format(valueDTO.DisplayValue, valueDTO.DisplayUnit));
 }
Ejemplo n.º 5
0
 public static string DisplayValue(this IWithDisplayUnit withDisplayUnit, double valueInCoreUnit)
 {
     return(_doubleFormatter.Format(withDisplayUnit.ConvertToDisplayUnit(valueInCoreUnit), withDisplayUnit.DisplayUnit));
 }
Ejemplo n.º 6
0
 public static string DisplayValueWithUnit(this IWithDisplayUnit withDisplayUnit, double valueInBaseUnit, IDimension valueDimension = null)
 {
     return(_doubleFormatter.Format(DisplayValue(withDisplayUnit, valueInBaseUnit, valueDimension), withDisplayUnit.DisplayUnit));
 }