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 1027 - Crash when exporting a SeriesBand Tool in Android
Summary: Crash when exporting a SeriesBand Tool in Android
Status: RESOLVED FIXED
Alias: None
Product: Java TeeChart
Classification: Unclassified
Component: Android (show other bugs)
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 06:00 EST by yeray alonso
Modified: 2014-12-01 06:01 EST (History)
0 users

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 yeray alonso 2014-12-01 06:00:50 EST
The following code reproduces the problem:

  private void initializeChart() {
    tChart1.getAspect().setView3D(false);
		
    Series series1 = new  Line(tChart1.getChart());
    series1.fillSampleValues();
		
    Series series2 = new  Line(tChart1.getChart());
    series2.fillSampleValues();
		
    SeriesBand band1 = new SeriesBand(tChart1.getChart());
    band1.setSeries(series1);
    band1.setSeries2(series2);
  }

  private void exportChart2Jpg() {
    checkExternalStorage();

    if (mExternalStorageAvailable) {
      if (mExternalStorageWriteable) {
        final File ExtPath = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "TeeChart");
        ExtPath.mkdirs();
        String path = ExtPath.getAbsolutePath() + File.separator + "Java2Image.jpg";
				
        Image im = tChart1.getExport().getImage().image(380, 600);
				
        try {
          im.save(path, "jpg", null);
        } catch (FileNotFoundException e) {
          e.printStackTrace();
        }
      }
    }
  }

Don't forget to add the WRITE_EXTERNAL_STORAGE permission before the application tag in the Manifest:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />