teeChart post plotting null points issue

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

teeChart post plotting null points issue

Post by Turc » Wed Jul 28, 2010 6:57 pm

I've set my program to plot a null point ( .add() ) on the chart if the value exceeds a certain threshold or if it times out - which it does (stop point). Then onces the value goes back down beneath the threshold or comes back from a timeout it starts plotting the points again (start point), but it also plots a line from the previous stop point to the new start point, which defeats the purpose of adding null points to the plot.

Any idea on how to keep those null points?

Thank you in advance for your time!

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: teeChart post plotting null points issue

Post by Turc » Thu Jul 29, 2010 2:56 pm

Anyone?

I'm using Fastline.

Yeray
Site Admin
Site Admin
Posts: 9543
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: teeChart post plotting null points issue

Post by Yeray » Fri Jul 30, 2010 2:26 pm

Hi Turc,

Is it possible that you have your series TreatNulls property set as SKIP?

Code: Select all

        tChart1.getAspect().setView3D(false);

        com.steema.teechart.styles.Line line1 = new com.steema.teechart.styles.Line(tChart1.getChart());
        line1.fillSampleValues(10);
        line1.getPointer().setVisible(true);

        line1.setNull(5);

        line1.setTreatNulls(TreatNullsStyle.SKIP);
Try changing it to DONOTPAINT:

Code: Select all

line1.setTreatNulls(TreatNullsStyle.DONOTPAINT);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: teeChart post plotting null points issue

Post by Turc » Fri Jul 30, 2010 3:09 pm

Thank you for replying back, I tried changing all the settings and still nothing. It doesn't plot null points, but once it starts plotting valid points, it reconnects the points.

here is a sample of my code:

Code: Select all

FastLine TemperatureSeries = new FastLine(temperatureStripChart.getChart().chart);
TemperatureSeries.setTreatNulls(TreatNullsStyle.DONOTPAINT);
TemperatureSeries.setVisible(true);        //won't let me access .getPointer() when using FastLine
...

//in a different class
if(temperature > 33)
{
     myChart.getSeries(0).add();
}
else
{
     myChart.getSeries(0).add(sampleTime, temperature);
     myChart.setMinMax();
}
I've tried setting/changing every possible setting that it lets me change/set and still nothing. Line does the same thing. I'm currently using Points, but thats not fast enough and when the temperature suddenly jumps or drops, you can see the gaps.

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: teeChart post plotting null points issue

Post by Turc » Fri Jul 30, 2010 3:22 pm

I don't need it to plot NULL points for when it exceeds a certain temperature - that was more for debugging purposes. What i need it for is when i hit the button "Stop", it stops. Wait a certain amount of time, then select "Start", and it starts from the current time, but it reconnects the previous plotted point which i DO NOT want it to do, and shouldn't do.

I've honestly tried everything and starting to firmly believe that its a bug. The only graph type that doesn't reconnect the points is the Point types.

Yeray
Site Admin
Site Admin
Posts: 9543
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: teeChart post plotting null points issue

Post by Yeray » Mon Aug 02, 2010 5:54 pm

Hi Turc,

In the following example I have a Chart and a button. When the button is clicked, the @action is executed ans a null value and 10 more values are added to the line series. I can see the gap, don't you?.

Code: Select all

    private com.steema.teechart.styles.Line line1;
    private void initChart() {
        tChart1.getAspect().setView3D(false);

        line1 = new com.steema.teechart.styles.Line(tChart1.getChart());
        line1.fillSampleValues(10);
        line1.getPointer().setVisible(true);

        line1.setTreatNulls(TreatNullsStyle.DONOTPAINT);
    }

    @Action
    public void clicked() {
        line1.add();

        double tmp;
        java.util.Random rnd = new java.util.Random();
        for (int i=0; i<10;i++)
        {
            tmp = line1.getYValues().getRange() / 2;
            line1.add(line1.getYValues().getValue(line1.getCount()-1) + rnd.nextDouble()*tmp - tmp/2);
        }
    }
If you still have troubles with it, please try to arrange a simple example project we an run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: teeChart post plotting null points issue

Post by Turc » Wed Aug 04, 2010 6:36 pm

Thank you for the help. added this and it worked:

.setNull(myChart.getSeries(0).getCount(), true);

Yeray
Site Admin
Site Admin
Posts: 9543
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: teeChart post plotting null points issue

Post by Yeray » Thu Aug 05, 2010 10:43 am

Hi Turc,

I'm glad to see it!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply