Strange quetion

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Strange quetion

Post by Dmitry » Tue Dec 01, 2015 3:58 pm

Can i render chart not throw SWT/AWT/Swing widget but directly to image?
I want use RAP ( https://www.eclipse.org/rap/ ) and need ready image only

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange quetion

Post by Yeray » Wed Dec 02, 2015 12:39 pm

Hello,

I haven't tried it, but have you tried to export your chart as an image and use it in your RAP application?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Strange quetion

Post by Dmitry » Thu Dec 03, 2015 2:24 pm

hmmm
example pls
now new TChart(Composite , style)
but I want render chart without parent composite
How to do it?

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Strange quetion

Post by Yeray » Fri Dec 04, 2015 10:35 am

Hello,

I can create a TChart without a parent and export it to an image with TeeChart Java Swing, so I guess you could do a similar thing in your RAP application:

Code: Select all

import java.io.IOException;

import com.steema.teechart.TChart;
import com.steema.teechart.styles.Bar;

public class Test {
	
	public static void main(String args[]) {
		TChart Chart1 = new TChart();
		
		Bar bar1 = new Bar(Chart1.getChart());
		bar1.fillSampleValues();
		
		try {
			Chart1.getExport().getImage().getPNG().save("E://tmp//SwingTest.png");
		} catch (IOException e) {
			e.printStackTrace();
		}		
	}
}
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Strange quetion

Post by Dmitry » Mon Dec 07, 2015 4:00 pm

thank you
run to realize

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Strange quetion

Post by Dmitry » Mon Dec 07, 2015 4:17 pm

How set size for export chart?

chart1.setSize(800, 600) is not working;

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Strange quetion

Post by Dmitry » Mon Dec 07, 2015 6:59 pm

close last question

PNGFormat png = chart1.getExport().getImage().getPNG();
png.setWidth(parentTab.getSize().x - 10);
png.setHeight(parentTab.getSize().y - 100);

Post Reply