When you set the color of a line series with point markers, subsequent changes to the color only affect the line and not the pointer.
Code: Select all
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.steema.teechart.TChart;
import com.steema.teechart.drawing.Color;
import com.steema.teechart.styles.Histogram;
import com.steema.teechart.styles.Line;
import com.steema.teechart.styles.PointerStyle;
public class ChartTest {
public static void main(String[] args) throws InterruptedException {
line();
}
private static void line() throws InterruptedException{
JFrame frame = new JFrame();
ChartTest c = new ChartTest();
JPanel panel = new JPanel();
TChart chart = new TChart();
panel.add(chart);
frame.add(panel);
final Line l = new Line();
l.add(1,10);
l.add(2,20);
l.add(3,5);
l.add(4,25);
l.add(5,15);
l.setColor(Color.GREEN);
l.getPointer().setStyle(PointerStyle.DIAMOND);
l.getPointer().setVisible(true);
l.setChart(chart.getChart());
chart.getAspect().setView3D(false);
chart.getAspect().setSmoothingMode(false);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//wait a second
Thread.sleep(1000);
l.setColor(Color.BLUE);
//without the following line, the point markers will remain the same as before
l.getPointer().setColor(Color.BLUE);
}