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 1339

Summary: Almost no field is copied when cloning descendants of Series
Product: Java TeeChart Reporter: alex
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: critical CC: marc, sandra, yeray
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Test case for Bar series

Description alex 2015-10-12 09:07:11 EDT
When using cloneSeries it creates a new object and assigns properties from the cloned one. But assign method in subclasses of Series is either not redefined or doesn't copy a lot of fields (in Series too).

For example CustomBar has fields barSizePercent, depthPercent, offsetPercent which are configurable through settings, yet are not copied when cloning.

As a results if you customized and cloned a series almost all settings would be lost.
Comment 1 alex 2015-10-20 09:21:46 EDT
Created attachment 517 [details]
Test case for Bar series

This test case shows that a clonned serie doesn't copy settings from its original.

Please note that there is a lot of such fields which aren't copied and it is not limited to the Bar class. That's why fixing only these three won't help at all but writing a test case for all cases is too much. Because it's almost every field in almost every subclass of Series.
Comment 2 sandra pazos 2015-11-16 08:06:03 EST
The simple code below reproduces the problem: 

public static void initializeChart()
 {
    
    tChart1.getAspect().setView3D(false);
    tChart1.getLegend().setVisible(false);
    Bar bar = new Bar(tChart1.getChart());
    Bar  bar1 = new Bar(tChart1.getChart()); 
    bar.setBarWidthPercent(100);
    bar.add(77); 
    bar.add(66);
    bar.add(33); 
    bar.setColor(Color.red);
    bar1 = (Bar) bar.cloneSeries();
 }
Comment 5 marc meumann 2016-04-13 09:24:49 EDT
Extensive assign modifications made for next maintenance release