Replies: 2 comments 1 reply
-
You might look at an |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking to find out the exact size in pixels of the Data area of an XYPlot. I know version 1.5x has a function you can call for this but I can't move to that version just yet. The end goal is related to scaling the draw result on a custom Graphics driver (DXFGraphics via https://jsevy.com). The approach is scale the Graphics instance before drawing so that the final output matches the real values plotted (in meters or feet) as opened in AutoCad and measured.
I've looked through the documentation and have actually gotten quite far with accomplishing this, but there is some padding or something that is not being considered.
Here is the relevant section of code that works perfectly for vertical scaling and extremely close for horizontal. Please help me find the missing padding I'm missing or misapplying. Thanks.
double hfactor=RefData.getDefault().getDxf_hscale_factor();//usually 2.0, as selected by user
RectangleInsets padding = this.getChart().getPadding();
RectangleInsets insets = this.getChart().getPlot().getInsets();
RectangleInsets axisoffsets = this.getChart().getXYPlot().getAxisOffset();
ValueAxis domainaxis=this.getChart().getXYPlot().getDomainAxis();
ValueAxis rangeaxis=this.getChart().getXYPlot().getRangeAxis();
Rectangle visiblerect=this.getVisibleRect();//incoming visible rectangle starts at 0,0
Beta Was this translation helpful? Give feedback.
All reactions