Last change
on this file since 1194 was
1194,
checked in by mstoeger, 16 years ago
|
Implemented a continuous-, discrete- and string- label provider for the X/Y axis labels. (#433)
|
File size:
379 bytes
|
Line | |
---|
1 | using System;
|
---|
2 |
|
---|
3 | namespace 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.