首页 > 代码库 > DynamicDataDisplay中CursorCoordinateGraph显示时间

DynamicDataDisplay中CursorCoordinateGraph显示时间

           
CursorCoordinateGraph cursorGraph = new CursorCoordinateGraph();

// setting new text mappings cursorGraph.XTextMapping = value =http://www.mamicode.com/> {   if (Double.IsNaN(value))     return "";   DateTime time = dateAxis.ConvertFromDouble(value);   return time.ToLongTimeString(); }; plotter.Children.Add(cursorGraph);
 <c:ChartPlotter.HorizontalAxis>
    <c:HorizontalDateTimeAxis Name="dateAxis"/>
</c:ChartPlotter.HorizontalAxis>    

  

private EnumerableDataSource<StockInfo> CreateCurrencyDataSource(List<StockInfo> rates)
{
  
EnumerableDataSource<StockInfo> ds = new EnumerableDataSource<StockInfo>(rates);

  ds.SetXMapping(ci => dateAxis.ConvertToDouble(ci.Date));
  ds.SetYMapping(ci => ci.Rate);
  return ds;

}

  

DynamicDataDisplay中CursorCoordinateGraph显示时间