Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 704 - Series.changeType changes series order in series collection
Summary: Series.changeType changes series order in series collection
Status: RESOLVED FIXED
Alias: None
Product: Java TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-07 07:31 EDT by kahlert
Modified: 2014-05-15 11:37 EDT (History)
3 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kahlert 2014-04-07 07:31:47 EDT
4 graphs A, B, C and D are displayed as lines. A should be changed to bars (A*). The expected result should be A*, B, C, D, but the result is A*, C, D, B.

the method Series.changeType changes the type of the graph by appending a new one to the collection and copying the attributes/values. This results is "A, B, C, B, A*". 
A will be disposed (in Series.assignDispose): B, C, B, A*
At least, the method SeriesCollection.moveTo is called which does not move but swap the values: A*, C, D, B.
Comment 1 sandra pazos 2014-04-11 11:55:04 EDT
The code below reproduce the problem: 
	private static void createChart(Shell tmpShell) {
		tChart1 = new TChart(tmpShell, 0);
	}
	
	private static void initializeChart() {
        com.steema.teechart.themes.ThemesList.applyTheme(tChart1.getChart(), 1);

        tChart1.getAspect().setView3D(false);
        Line line1,line2,line3,line4; 
        line1 = new Line(tChart1.getChart());
        line2 = new Line(tChart1.getChart()); 
        line3 = new Line(tChart1.getChart());
        line4 = new Line(tChart1.getChart()); 
        line1.fillSampleValues();
        line2.fillSampleValues();
        line3.fillSampleValues();
        line4.fillSampleValues();
        try {
			com.steema.teechart.styles.Series.changeType(line1, Bar.class);
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} 
	}
}