Skip to content

SignalConst: Expose Data to allow users to set X and Y offsets #4253

@RR-Git-Projects

Description

@RR-Git-Projects

Question: (Ask your question here)
I can plot Signal plots just fine using a date axis and offset, but doing the same process on a SignalConst plot seems to be impossible?

For a Signal plot (plotting data by the minute) this works great:

List<Double> ys = new List<Double>();

for (int row = 0; row < test_data.Rows.Count; row++)
{
    ys.Add(Convert.ToDouble(test_data.Rows[row][1]));
}

ScottPlot.Plottables.Signal line = SignalPlot.Plot.Add.Signal(ys: ys.ToArray());
line.Data.XOffset = System.DateTime.Now.ToOADate();
line.Data.Period = 1.0 / (60.0 * 24.0);
SignalPlot.Plot.Axes.DateTimeTicksBottom();
SignalPlot.Plot.Axes.AutoScale();
SignalPlot.Refresh();

But the Data property is obviously inaccessible for SignalConst plots, so dates always start at 1900-01-01. I tried various ways of trying to add the offset before plotting, but none of them seem to work. Am I missing something here?

ScottPlot Version:
Scottplot.Blazor 5.0.39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions