Hi Michael,
Thanks for your revert. We have analyzed your queries. Please find the response for your queries below.
Query1: We don't set a width for the chart or the container. We don't know how wide the users screen is so we use percentages for the container. Can the charts be setup to work in this configuration?
Answer: Yes. We can set up the chart to work in this configuration. For this case, we can set width in “%”. Please find the below code example.
[JS]
<div id="container" style="border:2px solid black;"></div>
$("#container").ejChart({
size: { height: "450", width:"50%" },
}); |
In the above code, we have set the chart width as “50%” and height as 450. Now chart will take “50%” width of container and height as “450”. Please find the screenshot below.
Query2: I have tried setting a percentage width but that results in the chart not drawing. It only accepts fixed pixel widths, which don't work for a page that resizes for users.
Answer: If you want to maintain width and height of the chart in percentage, then atleast you have to mention height of the container <div>. Because if the height of the <div> is not mentioned then it is not possible to get the height of the container <div>. If height of container <div> is mentioned then as per the javascript behavior height will retuned as “0” and width of window will returned as width. For this 0 height and window’s width percentage values will be calculated. Since height is returned as 0 chart will render with 0 height and won’t get displayed in browser. This is current behavior of the chart.
In the below link, we have attached sample for your reference
Please let us know if you have any concern.
Regards,
Sanjith.