Transparent Datapoints Xamarin Android
Posted: Tue Sep 22, 2015 7:55 am
The solution (which was recommended by you) works very well in regular Dot.Net, but does not work when running under Xamarin.Android. (As shown in the screenshot above, a line is drawn between the two relevant data points (Arrowed in red))
The problem seems to be that "chart.Series[0][PressureGraphCursor + 1].Color = System.Drawing.Color.Transparent;" is ignored.
Can you suggest a solution?
Many thanks,
Andy Pybus
The working (PC) version is:
private void UpdateGraphs()
{
short val;
if (Pressure_Data.TryDequeue(out val)) //If data points are available...
{
//PRESSURE GRAPH
if (InputPressure.Count > PressureGraph.Axes.Bottom.Maximum) //If we've accumulated at least 1 scan...
{
InputPressure[PressureGraphCursor].Y = val * VARIABLESCALEFACTOR;
InputPressure[PressureGraphCursor].Color = InputPressure.Color;
InputPressure[PressureGraphCursor + 1].Color = Color.Transparent;
}
else
{
InputPressure.Add(val * VARIABLESCALEFACTOR);
}
PressureGraphCursor++;
PressureGraphCursor = (PressureGraphCursor < PressureGraph.Axes.Bottom.Maximum) ? PressureGraphCursor : 0;
}
if ((PressureGraphCursor % SIGNALFREQUENCY == 0) && (Mode == OpMode.File) && (PlotTimer.IsRunning)) GetNextDORecord();
//FFT GRAPH
if (FftGraphIsAvailable) DisplayCurrentFFT();
}
The Xamarin.android version is:
void UpdateGraphs(Steema.TeeChart.TChart chart)
{
chart.AutoRepaint = false;
short val;
if (Pressure_Data.TryDequeue(out val)) //If data points are available...
{
//PRESSURE GRAPH
if (chart.Series[0].Count > PressureGraph.Axes.Bottom.Maximum) //If we've accumulated at least 1 scan...
{
chart.Series[0][PressureGraphCursor].Y = val * VARIABLESCALEFACTOR;
chart.Series[0][PressureGraphCursor].Color = chart.Series[0].Color;
chart.Series[0][PressureGraphCursor + 1].Color = System.Drawing.Color.Transparent;
}
else
{
chart.Series[0].Add(val * VARIABLESCALEFACTOR);
}
PressureGraphCursor++;
PressureGraphCursor = (PressureGraphCursor < PressureGraph.Axes.Bottom.Maximum) ? PressureGraphCursor : 0;
}
chart.AutoRepaint = true;
chart.Chart.Invalidate();
}