Answer the question
In order to leave comments, you need to log in
How to fix MaxRenderIndex must be positive error in C# ScottPlot?
I have a database, with columns: Date time, CX, CY, CZ. I have a class that works with this database and now I want to draw a graph from this database (MySQL).
Here is my code:
DateTime start = new DateTime(1900, 1, 1);
List<double> dates = new List<double>();
List<SignalPlot> signalsX = new List<SignalPlot>();
List<SignalPlot> signalsY = new List<SignalPlot>();
List<SignalPlot> signalsZ = new List<SignalPlot>();
List<double> valuesX = new List<double>();
List<double> valuesY = new List<double>();
List<double> valuesZ = new List<double>();
List<string> listDates = new List<string>();
List<string> listX = new List<string>();
List<string> listY = new List<string>();
List<string> listZ = new List<string>();
listDates = DB.Select(ref conn, "Date time");
listX = DB.Select(ref conn, "CX");
listY = DB.Select(ref conn, "CY");
listZ = DB.Select(ref conn, "CZ");
for (int i = 0; i < listX.Count; i++)
{
valuesX.Add(double.Parse(listX[i]));
valuesY.Add(double.Parse(listY[i]));
valuesZ.Add(double.Parse(listZ[i]));
}
double samplesPerDay = (24 * 60);
var sig = formsPlot1.Plot.AddSignal(valuesX.ToArray(), sampleRate: samplesPerDay);
sig.OffsetX = start.ToOADate();
formsPlot1.Plot.XAxis.DateTimeFormat(true);
formsPlot1.Refresh();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question