背景图像属性未正确设置

发布于 2024-10-21 22:02:13 字数 1333 浏览 2 评论 0原文

按照这个例子 http://teethgrinder.co.uk/open-flash-chart /gallery-bg-image.php

我正在尝试

import com.extjs.gxt.charts.client.model.ChartModel

ChartModel cm = new ChartModel(graphTitle, "color: #738995;font-weight: bold;font-size: 20px; font-family: arial; text-align: left;");
 cm.setBackgroundColour("ffffff");

 cm.set("bg_image", "http://teethgrinder.co.uk/open-flash-chart/images/logo.png");
 cm.set("bg_image_x","right");
 cm.set("bg_image_y","top");

没有 bg_image(_x,_y) 位一切正常 它抛出的位

(字符串):调用 NPObject 上的方法时出错! [插件异常:Actionscript 中出现错误。使用 try/catch 块来查找错误。]。

ChartModel cm = getChartModel(dataSet);
        try {
           this.setChartModel(cm);
        } catch (Exception ex)
        {
         GWTMessageHandler.handleInfoMessage(
         "Message ="+ex.getMessage()+
         "Cause = "+ex.getCause()+
         "getLocalizedMessage = "+ex.getLocalizedMessage()+
         "StackTrace="+ex.getStackTrace());
        }

返回消息=(字符串):调用 NPObject 上的方法时出错! [插件异常:Actionscript 中出现错误。使用 try/catch 块查找错误。].Cause = nullgetLocalizedMessage = (String): 在 NPObject 上调用方法时出错! [插件异常:Actionscript 中出现错误。使用 try/catch 块查找错误。].StackTrace=[Ljava.lang.StackTraceElement;@2ff

following this example
http://teethgrinder.co.uk/open-flash-chart/gallery-bg-image.php

I'm trying

import com.extjs.gxt.charts.client.model.ChartModel

ChartModel cm = new ChartModel(graphTitle, "color: #738995;font-weight: bold;font-size: 20px; font-family: arial; text-align: left;");
 cm.setBackgroundColour("ffffff");

 cm.set("bg_image", "http://teethgrinder.co.uk/open-flash-chart/images/logo.png");
 cm.set("bg_image_x","right");
 cm.set("bg_image_y","top");

without the bg_image(_x,_y) bit everything works
with the bit it throws

(String): Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].

ChartModel cm = getChartModel(dataSet);
        try {
           this.setChartModel(cm);
        } catch (Exception ex)
        {
         GWTMessageHandler.handleInfoMessage(
         "Message ="+ex.getMessage()+
         "Cause = "+ex.getCause()+
         "getLocalizedMessage = "+ex.getLocalizedMessage()+
         "StackTrace="+ex.getStackTrace());
        }

returns Message =(String): Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].Cause = nullgetLocalizedMessage = (String): Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].StackTrace=[Ljava.lang.StackTraceElement;@2ff

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉城メ夜风 2024-10-28 22:02:13

编辑:
听起来 JavaScript 和 ActionScript 之间的交互受到了安全限制的阻碍。尝试这个安全调整


将您的代码包装在像这样的 try/catch 块中,看看它试图告诉您什么:

try{
    ChartModel cm = new ChartModel(graphTitle, "color: #738995;font-weight: bold;font-size: 20px; font-family: arial; text-align: left;");
    cm.setBackgroundColour("ffffff");

    cm.set("bg_image", "http://teethgrinder.co.uk/open-flash-chart/images/logo.png");
    cm.set("bg_image_x","right");
    cm.set("bg_image_y","top");
} catch(err:Error) {
    trace("name: " + err.name);
    trace("message: " + err.message);
    trace("problem code: " + err.getStackTrace());
}

在不摆弄代码的情况下,我的第一个猜测是以下几行应该采用数字而不是字符串:

cm.set("bg_image_x","200"); //instead of "right"
cm.set("bg_image_y","0"); //instead of "top"

EDIT:
It sounds like the interaction between JavaScript and ActionScript is being hindered by security constraints. Try this security adjustment.


wrap your code in a try/catch block like this and see what it's trying to tell you:

try{
    ChartModel cm = new ChartModel(graphTitle, "color: #738995;font-weight: bold;font-size: 20px; font-family: arial; text-align: left;");
    cm.setBackgroundColour("ffffff");

    cm.set("bg_image", "http://teethgrinder.co.uk/open-flash-chart/images/logo.png");
    cm.set("bg_image_x","right");
    cm.set("bg_image_y","top");
} catch(err:Error) {
    trace("name: " + err.name);
    trace("message: " + err.message);
    trace("problem code: " + err.getStackTrace());
}

Without fiddling with the code, my first guess would be that the following lines should take numbers instead of strings:

cm.set("bg_image_x","200"); //instead of "right"
cm.set("bg_image_y","0"); //instead of "top"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文