-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Hi Scott, thank you for this great library.
Feature Suggestion
Imo FinancePlot could reuse existing data structures which come from webservices, databases or elsewhere without creating new Ohlc instances.
Feature description:
- ScottPlot define an Interface describing the OHLC structure
- X axis lables using ohlc.DateTime in sequential mode
Code example:
public interface IOhlc
{
public double Open { get; }
public double High { get; }
public double Low { get; }
public double Close { get; }
public double Volume { get; }
public DateTime DateTime { get; }
public TimeSpan TimeSpan { get; }
}
public class FinancePlot : IPlottable
{
/// <summary>
/// Create a finance plot from existing OHLC data.
/// </summary>
/// <param name="ohlcs"></param>
public FinancePlot(IEnumerable <IOhlc> ohlcs)
{
...
}
/// <summary>
/// Add a single OHLC to the plot
/// </summary>
/// <param name="ohlc"></param>
public void Add(IOhlc ohlc)
{
...
}
/// <summary>
/// Add multiple OHLCs to the plot
/// </summary>
/// <param name="ohlcs"></param>
public void AddRange(IEnumerable <IOhlc> ohlcs)
{
...
}
/// <summary>
/// Returns the last element of OHLCs so users can modify FinancePlots in real time.
/// </summary>
public IOhlc Last() => ...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels