Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/LabelProvider/DiscreteLabelProvider.cs @ 1194

Last change on this file since 1194 was 1194, checked in by mstoeger, 15 years ago

Implemented a continuous-, discrete- and string- label provider for the X/Y axis labels. (#433)

File size: 379 bytes
Line 
1using System;
2
3namespace HeuristicLab.Visualization.LabelProvider {
4  public class DiscreteLabelProvider : ILabelProvider {
5    public string GetLabel(double value) {
6      int index = (int)Math.Round(value);
7      double delta = Math.Abs(index - value);
8
9      if (delta < 1e-10)
10        return index.ToString();
11      else
12        return string.Empty;
13    }
14  }
15}
Note: See TracBrowser for help on using the repository browser.