Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/TimeChartPlotter.cs @ 13376

Last change on this file since 13376 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 1.1 KB
Line 
1using System;
2using Microsoft.Research.DynamicDataDisplay;
3using System.Windows;
4using Microsoft.Research.DynamicDataDisplay.Navigation;
5using Microsoft.Research.DynamicDataDisplay.Common;
6using System.Windows.Controls;
7using Microsoft.Research.DynamicDataDisplay.Charts;
8
9
10namespace Microsoft.Research.DynamicDataDisplay
11{
12  public class TimeChartPlotter : ChartPlotter
13  {
14    public TimeChartPlotter()
15    {
16      MainHorizontalAxis = new HorizontalDateTimeAxis();
17    }
18
19    public void SetHorizontalAxisMapping(Func<double, DateTime> fromDouble, Func<DateTime, double> toDouble)
20    {
21      if (fromDouble == null)
22        throw new ArgumentNullException("fromDouble");
23      if (toDouble == null)
24        throw new ArgumentNullException("toDouble");
25 
26
27      HorizontalDateTimeAxis axis = (HorizontalDateTimeAxis)MainHorizontalAxis;
28      axis.ConvertFromDouble = fromDouble;
29      axis.ConvertToDouble = toDouble;
30    }
31
32    public void SetHorizontalAxisMapping(double min, DateTime minDate, double max, DateTime maxDate) {
33      HorizontalDateTimeAxis axis = (HorizontalDateTimeAxis)MainHorizontalAxis;
34     
35      axis.SetConversion(min, minDate, max, maxDate);
36    }
37  }
38}
Note: See TracBrowser for help on using the repository browser.