根据jFreeChart.createBufferedImage(width,Height,info)中的客户端屏幕分辨率动态设置宽度和高度 [英] Dynamically setting width and height according to client screen resolution in jFreeChart.createBufferedImage(width,Height,info)
问题描述
我有一个关于JfreeChart.createBufferedImage(width,Height,info)的问题 我正在用Java创建一个jFreechart并将其显示在JSF页面中,例如JfreeChart.createBufferedImage(width,Height,info)
I have a problem regarding JfreeChart.createBufferedImage(width,Height,info) i am creating a jFreechart in java and showing it in JSF page like this JfreeChart.createBufferedImage(width,Height,info)
现在我将宽度和高度作为硬编码属性传递 但是我希望宽度和高度应该在JSF页面中动态设置编码cleint屏幕的分辨率.
Right now i am passing width and height as hardcoded attributes but i want the width and height should dynamically set accoding the cleint screen resolution in JSF page.
有什么办法吗?
推荐答案
没有直接的方法.如果您不熟悉JSF生命周期,请检查一下( balusc撰写了一篇很棒的文章),但是实质上的过程是这样的:
There isn't a straight forward way. If you aren't familiar with the JSF lifecycle I would check it out (balusc made a great article), but essentially the process would be this:
- 初始响应使用javascript发送给客户端
- Javascript获取屏幕大小并将其插入隐藏字段中并提交表单
- 第二个响应是您当前的页面,但隐藏字段中的数字除外.
您可能需要一个支持ajax的框架,该框架可让您进行轮询,以便在窗口更改时可以适当地重新生成图表.
这篇关于根据jFreeChart.createBufferedImage(width,Height,info)中的客户端屏幕分辨率动态设置宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!