Page 1 of 1

Line Series in TeeChart v2

Posted: Fri Mar 20, 2009 5:11 pm
by 7667592
After upgrading, I discovered different behavior. It is easy to accomodate, so I am not requesting any action. Anyway, FYI in case it wasn't expected.

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

Posted: Mon Mar 23, 2009 9:21 am
by yeray
Hi Jesse,

We've tried to reproduce this issue but couldn't with the actual sources nor with v2 installer.

Are you sure that you haven't skipped to mention any important step?