Commit Latest
This commit is contained in:
@@ -4,6 +4,7 @@ using Eremex.AvaloniaUI.Charts;
|
||||
using MarketData.MarketDataModel;
|
||||
using MarketData.MarketDataModel.GainLoss;
|
||||
using MarketData.Numerical;
|
||||
using MarketData.Utils;
|
||||
using PortfolioManager.DataSeriesViewModels;
|
||||
|
||||
namespace PortfolioManager.Models
|
||||
@@ -27,16 +28,24 @@ namespace PortfolioManager.Models
|
||||
{
|
||||
if (null == price) return Empty();
|
||||
SortedDateTimeDataAdapter sortedDateTimeDataAdapter = new SortedDateTimeDataAdapter();
|
||||
sortedDateTimeDataAdapter.Add(price.Date, price.Close);
|
||||
CompositeDataSource compositeDataSource = new CompositeDataSource()
|
||||
{
|
||||
DataAdapter = sortedDateTimeDataAdapter
|
||||
};
|
||||
return compositeDataSource;
|
||||
}
|
||||
|
||||
|
||||
// CompositeDataSource compositeDataSource;
|
||||
// var xData = new EnumerableDataSource<DateTime>(new DateTime[]{price.Date});
|
||||
// xData.SetXMapping(x => (x.Ticks / 10000000000.0));
|
||||
// var yData = new EnumerableDataSource<double>(new double[]{price.Close});
|
||||
// yData.SetYMapping(y => y);
|
||||
// compositeDataSource = xData.Join(yData);
|
||||
// return compositeDataSource;
|
||||
return Empty();
|
||||
public static CompositeDataSource CreateCompositeDataSource(DateTime xSource, double ySource)
|
||||
{
|
||||
if (Utility.IsEpoch(xSource)) return Empty();
|
||||
SortedDateTimeDataAdapter sortedDateTimeDataAdapter = new SortedDateTimeDataAdapter();
|
||||
sortedDateTimeDataAdapter.Add(xSource, ySource);
|
||||
CompositeDataSource compositeDataSource = new CompositeDataSource()
|
||||
{
|
||||
DataAdapter = sortedDateTimeDataAdapter
|
||||
};
|
||||
return compositeDataSource;
|
||||
}
|
||||
|
||||
// This is the active gain/loss as number or percent.
|
||||
|
||||
Reference in New Issue
Block a user