Transparent Datapoints Xamarin Android

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Transparent Datapoints Xamarin Android

Post by Anaesthesia » Tue Sep 22, 2015 7:55 am

Screenshot.jpg
Screenshot.jpg (138.96 KiB) Viewed 5071 times
I'm creating an 'Oscilloscopic' ECG system which requires that datapoints be transparent when the second and subsequent screen scans are made. The problem is described fully in the post on oscilloscopic emulation.

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();
}

Anaesthesia
Newbie
Newbie
Posts: 22
Joined: Mon Aug 24, 2015 12:00 am

Re: Transparent Datapoints Xamarin Android

Post by Anaesthesia » Tue Sep 22, 2015 10:33 am

OOPs - I forgot to specify:

fastLine1.TreatNulls = Steema.TeeChart.Styles.TreatNullsStyle.DoNotPaint; - This fixes the problem!

Post Reply