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 - Almost no field is copied when cloning descendants of Series
Summary: Almost no field is copied when cloning descendants of Series
Status: RESOLVED FIXED
Alias: None
Product: Java TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- critical
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-12 09:07 EDT by alex
Modified: 2016-04-13 09:24 EDT (History)
3 users (show)

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


Attachments
Test case for Bar series (578 bytes, text/x-java)
2015-10-20 09:21 EDT, alex
Details

Note You need to log in before you can comment on or make changes to this bug.
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