|
Scatter Point Truncation and its labels |
Posted by Ankit Jain on Dec-22-2017 13:21 |
|
Hi Peter,
I am running into strange problem where output is coming as per the expectation in SVG but not in JPG image.
Please find attached documents that contains chart image for both jpg and svg.
I understand that SVG renders the image beyond chart boundaries. How can I make sure that label and scatter point will not be cropped in case of jpg image.
Appreciate your help
Thanks
Ankit
|
Re: Scatter Point Truncation and its labels |
Posted by Peter Kwan on Dec-22-2017 21:32 |
|
Hi Ankit,
Without the exact JPG and SVG file, I can only guess what is the reason. I guess that the label is simply outside the chart.
I think you know all JPG images have a fixed size. If the chart image is 500 pixels wide, and you put the label x=510, it is impossible to include the label in JPG, because the JPG is only 500 pixels wide.
The SVG is scalable, which means it can assume any size as determined by the viewer (the viewer is the browser for web applications). Normally, the viewer will draw things that is outside the "viewport" of the SVG. This means the browser will draw the label even if it overflows the viewport.
If your want the SVG to look like the JPG with the label trimmed, you may try to set a fixed size to the SVG output, and configure the style of the HTML element that contains the SVG to overflow:hidden. See:
https://www.w3schools.com/cssref/pr_pos_overflow.asp
Regards
Peter Kwan |
Re: Scatter Point Truncation and its labels |
Posted by Peter Kwan on Dec-23-2017 00:12 |
|
Hi Ankit,
If you want the labels not cropping on the JPEG image, the only method is to make the plot area smaller or to make the image wider, so as to reserve space for the label.
Regards
Peter Kwan |
|