Plotting Points
Posted: Thu Jun 21, 2012 6:38 pm
The first few points do not plot on the graph when I plot points in real time.
If you look at the attachement, the black and red dots only show up if there is a point plotted. They show up, but the points are not plotted. This happens every time it starts plotting points.
If you look at the attachement, the black and red dots only show up if there is a point plotted. They show up, but the points are not plotted. This happens every time it starts plotting points.
Code: Select all
public void plotPoints(int pt1, int pt2)
{
DateTime dtTime = DateTime.getNow();
if((pt1 == 0) && (pt2 == 0))
{
int nLastVisible = m_csPt1Series.getLastVisible();
double dblValue = m_csPt1Series.getPoint(nLastVisible).getY();
m_csPt1Series.add(dtTime, dblValue, Color.transparent);
m_csPt1Series.setNull(m_csPt1Series.getCount(), true);
nLastVisible = m_csPt2Series.getLastVisible();
dblValue = m_csPt2Series.getPoint(nLastVisible).getY();
m_csPt2Series.add(dtTime, dblValue, Color.transparent);
m_csPt2Series.setNull(m_csPwrSeries.getCount(), true);
}
else //plot
{
m_csPt1Series.add(dtTime, pt1);
m_csPt2Series.add(dtTime, pt2);
}
if(m_csPt1Series.getCount() >= CHART_SIZE)
m_csPt1Series.delete(0);
if(m_csPt2Series.getCount() >= CHART_SIZE)
m_csPt2Series.delete(0);
setMinMax(); //Moves/updates the chart's x-axis
}