Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 saving the FinOHLCPlot as image

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
pb_1 Posted - 10 Apr 2008 : 02:08:24
I am trying to save the FinOHLCPlot from the
QuinnCurtis\java\com\quinncurtis\chart2djava\examples\financialexamplesas image. But it is giving me the error:
Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.BufferedImage.<init>(Unknown Source)
at com.quinncurtis.chart2djava.ChartBufferedImage.render(ChartBufferedImage.java:154)
at com.quinncurtis.chart2djava.examples.financialexamples.FinOHLCPlot.SaveJPEG(FinOHLCPlot.java:422)
at com.quinncurtis.chart2djava.examples.financialexamples.FinOHLCPlot.main(FinOHLCPlot.java:428)

How do I save this high-low-open-close plot as a image. Can you please help me with this? Please let me know if you need any more clarifications.
1   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 10 Apr 2008 : 09:39:54
Saving a chart as an image has nothing to do with the chart type.

I would guess that you are trying to save the chart before it has actually been drawn. Defining the chart, as done in the FinOHLCPlot constructor of the example, does not draw it. The chart is drawn in response to the windows draw event later on. Until the chart is drawn, it does not have a size. Add a menu to the application and then invoke the examples SaveAsJPeg function from the menu. That way, you can see the chart when you invoke the SaveAsJPeg routine.

The tutorial example, LinePlotSalesVolume has a simple example of saving a chart as an image. You should run that and select File | Save As Jpg from the charts simple menu. Once you verify it works, study the code, then either add the appropriate code to your own program, or replace the exisiting chart in the LinePlotSalesVolume with the FinOHLCPlot chart.

This discussion assumes that you actually want to display the chart on the screen. Specify if it is otherwise.

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07