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 420

Summary: [TJ71016541] In TeeChart Java Android, when you add a SeriesBand some parts of the...
Product: Java TeeChart Reporter: yeray alonso <yeray>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED WORKSFORME    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2013-11-20 12:15:34 EST
In TeeChart Java Android, when you add a SeriesBand some parts of the chart seem to be drawn relative to wrong parts of the view. See the title and the area in the following cases.
*********
Case 1:
Having the chart in the root layout, if we have some more objects, the title and the area series are drawn as if the chart took all the space.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/chart_layout1" >
    
    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    
    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    
</LinearLayout>
Here's the code:
  tChart1.getAspect().setView3D(false);
  Area area1 = new Area(tChart1.getChart());
  area1.fillSampleValues();
  SeriesBand band1 = new SeriesBand(tChart1.getChart());
  band1.setSeries(area1);
  tChart1.getPanel().setMarginUnits(PanelMarginUnits.PIXELS);
  tChart1.getPanel().setMarginTop(30);
  tChart1.getHeader().setCustomPosition(true);
  tChart1.getHeader().setTop(7);
  DisplayMetrics metrics = new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);
  int headerWidth = tChart1.getGraphics3D().textWidth(tChart1.getHeader().getText());
  tChart1.getHeader().setLeft(metrics.widthPixels/2 - headerWidth/2);
See the image "Case 1".
*********
Case 2:
Having the chart in an second layout, the above problem is fixed.
However, if you add some padding to the chart layout, the same elements are moved again. And they seem to be moved as many pixels as the padding indicates.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    
    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    
    <Spinner
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />    
    
	<LinearLayout android:id="@+id/chart_layout1"
	    android:layout_width="fill_parent"
	    android:layout_height="fill_parent"
	    android:padding="10dip" />
</LinearLayout>
See the image "Case 2". [created:2013-03-20T13:46:58.000+01:00 reported by:yeray@steema.com reported in version:3.2012.0808 (TeeChart Java)]