Author |
Topic |
|
PeterJ
26 Posts |
Posted - 02 Jun 2010 : 17:10:13
|
I'm trying to place an icon centered within the plot area inside a ChartView. Methods such as getClippingBounds() give me the bounding rectangle of the ChartView area itself which includes the background, axis etc..
Is there a method available for getting the bounding box of the plot area itself (the area within the axis) |
|
quinncurtis
1586 Posts |
Posted - 02 Jun 2010 : 17:34:32
|
Call the coordinate system's getPlotRect() method.
ChartRectangle2D rect = pTransform1.getPlotRect();
We added the time zone option you suggested to the software. It is found in the TimeAxisLabels class.
TimeAxisLabels xAxisLab1 = new TimeAxisLabels(xAxis1); xAxisLab1.setLabelTimeZone( TimeZone.getTimeZone("GMT"));
You should be able to download the modified software using your original download links.
|
|
|
PeterJ
26 Posts |
Posted - 03 Jun 2010 : 11:57:10
|
Thank you on both counts!!! The getPlotRect() is working and I can place icons at precisely as I need too.
I'll test the setLabelTimeZone addition. That is very useful. |
|
|
quinncurtis
1586 Posts |
Posted - 03 Jun 2010 : 12:32:03
|
Our only comment is that placing things in a chart using pixel coordinates is troublesome, because the pixel coordinates are only finalized after the chart is drawn. Anytime the chart is re-sized, old pixel coordinates become invalid and objects will need to be replaced using the new pixel coordinates. We assume that if you have it working you know how to place, and re-place, the image icon after the chart is drawn.
If you place an image in a chart, (you should be able to load your icon as an image) using our ChartImage class, you can place it using physical, plot normalized, or chart normalized coordinates, which will always remain accurate and valid no matter what the chart size. See the ImageCharts example. |
|
|
|
Topic |
|
|
|