Hi,
I see that setIgnoreNulls() is not available for Line but it is available for FastLine. Is there any work around for this ?
I can display a a point on the Line using a rectangular shape but this is not available in FastLine. Is there any work around for this ?
If someone wants both these features to be included in a line chart then it is not possible now. Correct me if I am wrong.
Thanks,
Varun
setIgnoreNulls
Hi Varun,
For Line Series this property is not necesary. As in the Help says :I see that setIgnoreNulls() is not available for Line but it is available for FastLine. Is there any work around for this ?
For speed reasons, FastLine series supports null (empty) values only when IgnoreNulls property is false.
By default all points are displayed (IgnoreNulls is true by default).
To enable FastLine series to hide null points, set IgnoreNulls to false.
The way around would be to use Line Series instead. FastLine series has been designed to save time drawing points so some of the Line features has been disabled for this Series type. In your case you have two options, use the Line Series or use the FastLine Series in conjunction with a Point Series.I can display a a point on the Line using a rectangular shape but this is not available in FastLine. Is there any work around for this ?
Yes, both features can be used with the Line Series.If someone wants both these features to be included in a line chart then it is not possible now. Correct me if I am wrong.
Pep Jorge
http://support.steema.com
http://support.steema.com
Quote:
For speed reasons, FastLine series supports null (empty) values only when IgnoreNulls property is false.
By default all points are displayed (IgnoreNulls is true by default).
To enable FastLine series to hide null points, set IgnoreNulls to false.
>>>> What if I want to say setIgnoreNulls(false) for a Line series.
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.Line;
import com.steema.teechart.styles.MarksStyle;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(800, 800);
TChart chart = new TChart();
panel.add(chart);
chart.setSize(800, 800);
Line line = new Line(chart.getChart());
line.getMarks().setStyle(MarksStyle.LABEL);
chart.getAxes().getBottom().getLabels().setStyle(
com.steema.teechart.axis.AxisLabelStyle.AUTO);
for (int i = 0; i < 10; i++) {
if ((i != 3) && (i != 7))
line.add(i, i, " " + i);
else
line.setNull(line.add(0.0, " "));
}
line.getPointer().setVisible(true);
frame.add(panel);
frame.setSize(800, 800);
frame.setVisible(true);
}
}
If I run this program, then I will see a break between the lines. Is there any way I can join those two points ??
So if I see the example for fastline, then I can see that when I say setIgnoreNulls(true), then there are no breaks in between the lines. I want something like that.
Thanks,
Varun
For speed reasons, FastLine series supports null (empty) values only when IgnoreNulls property is false.
By default all points are displayed (IgnoreNulls is true by default).
To enable FastLine series to hide null points, set IgnoreNulls to false.
>>>> What if I want to say setIgnoreNulls(false) for a Line series.
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.Line;
import com.steema.teechart.styles.MarksStyle;
public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setSize(800, 800);
TChart chart = new TChart();
panel.add(chart);
chart.setSize(800, 800);
Line line = new Line(chart.getChart());
line.getMarks().setStyle(MarksStyle.LABEL);
chart.getAxes().getBottom().getLabels().setStyle(
com.steema.teechart.axis.AxisLabelStyle.AUTO);
for (int i = 0; i < 10; i++) {
if ((i != 3) && (i != 7))
line.add(i, i, " " + i);
else
line.setNull(line.add(0.0, " "));
}
line.getPointer().setVisible(true);
frame.add(panel);
frame.setSize(800, 800);
frame.setVisible(true);
}
}
If I run this program, then I will see a break between the lines. Is there any way I can join those two points ??
So if I see the example for fastline, then I can see that when I say setIgnoreNulls(true), then there are no breaks in between the lines. I want something like that.
Thanks,
Varun
Hi Varun,
ok, using the Line Series a way would be to use Add method instead of SetNull :
This will leave the line between points, although it will pass through the 0 Value, as IgnoreNulls of FastLine Series does. To hide pointers of 0 data points you will have to use the OnGetPointerStyle event (setting the 0 values to none pointer style).
In case you want to join the lines deleting the 0 points then the following code could be used :
For the next TeeChart for Java release a new feature related with Nulls has been introduce, it's the TreatNulls feature which allows to specify how the nulls points have to be treated (Dont paint, ignore or skip them). Then the following code should be used :
ok, using the Line Series a way would be to use Add method instead of SetNull :
Code: Select all
Line line = new Line(tChart2.getChart());
line.getMarks().setStyle(MarksStyle.LABEL);
tChart2.getAxes().getBottom().getLabels().setStyle(
com.steema.teechart.axis.AxisLabelStyle.AUTO);
for (int i = 0; i < 10; i++) {
if ((i != 3) && (i != 7))
line.add(i, i, " " + i);
else
line.add(0.0," ");
// line.setNull(line.add(0.0, " "));
}
line.getPointer().setVisible(true);
In case you want to join the lines deleting the 0 points then the following code could be used :
Code: Select all
Line line = new Line(tChart2.getChart());
line.getMarks().setStyle(MarksStyle.LABEL);
tChart2.getAxes().getBottom().getLabels().setStyle(
com.steema.teechart.axis.AxisLabelStyle.AUTO);
for (int i = 0; i < 10; i++) {
if ((i != 3) && (i != 7))
line.add(i, i, " " + i);
else
line.setNull(line.add(0.0, " "));
}
line.getPointer().setVisible(true);
for (int ii = 0; ii < tChart2.getSeries(0).getCount()-1; ii++) {
if (tChart2.getSeries(0).isNull(ii)) {
tChart2.getSeries(0).delete(ii);
}
}
Code: Select all
Line line = new Line(tChart2.getChart());
line.getMarks().setStyle(MarksStyle.LABEL);
tChart2.getAxes().getBottom().getLabels().setStyle(
com.steema.teechart.axis.AxisLabelStyle.AUTO);
for (int i = 0; i < 10; i++) {
if ((i != 3) && (i != 7))
line.add(i, i, " " + i);
else
line.setNull(line.add(0.0, " "));
}
line.getPointer().setVisible(true);
line.setTreatNulls(TreatNullsStyle.IGNORE);
Pep Jorge
http://support.steema.com
http://support.steema.com