44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using ScottPlot.Avalonia;
|
|
|
|
namespace PortfolioManager.ViewModels
|
|
{
|
|
public partial class ScottPlotViewModel : WorkspaceViewModel
|
|
{
|
|
public ScottPlotViewModel()
|
|
{
|
|
double[] dataX = { 1, 2, 3, 4, 5 };
|
|
double[] dataY = { 1, 4, 9, 16, 25 };
|
|
|
|
// AvaPlot avaPlot = this.Find<AvaPlot>("AvaPlot");
|
|
// ((ScottPlotViewModel)DataContext).Plotter = avaPlot;
|
|
|
|
|
|
if (Plotter != null)
|
|
{
|
|
Plotter.Plot.Add.Scatter(dataX, dataY);
|
|
Plotter.Refresh();
|
|
}
|
|
}
|
|
|
|
|
|
// ********************************************** P E R S I S T E N C E *************************
|
|
public override bool CanPersist()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public override SaveParameters GetSaveParameters()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public override void SetSaveParameters(SaveParameters saveParameters)
|
|
{
|
|
}
|
|
|
|
// **********************************************************************************************
|
|
|
|
public AvaPlot Plotter { get; set; } = default;
|
|
|
|
}
|
|
} |