Flex DataVisualization 图表组件在构建服务器上呈现标签的问题

发布于 2024-08-28 01:05:21 字数 681 浏览 6 评论 0原文

我遇到了标签在 Flex 的 datavisualization.swc 图表上消失的问题,这些图表是通过 ANT 和 Flex 3.3 SDK 在我们的构建服务器上构建的。我已确保我们的许可证在构建服务器上正确应用(因此没有水印),并且我已确保将完全相同的 datavisualization.swc 从我的开发计算机复制到 Flex3.3SDK/frameworks/libs 目录中。

有什么想法吗?会不会是字体问题? (尽管我们实际上只使用默认字体。)

这就是问题所在,构建服务器上缺少轴标签 替代文本 http://img687.imageshack.us/img687/5038/chartwithmissingaxislab.png< /a>

这是带有标签的样子(在我的本地开发机器上拍摄) 替代文本 http://img683.imageshack.us/img683/1504/chartwithaxislabels.png< /a>

I'm having a problem with labels disappearing on Flex's datavisualization.swc charts that are built on our build server via ANT and the Flex 3.3 SDK. I've made sure that our license is applied properly on the build server (hence no water marks), and I've made sure the exact same datavisualization.swc was copied from my dev machine into the Flex3.3SDK/frameworks/libs directory.

Any ideas? Could it be a font problem? (Though we're really only using default fonts.)

Here's the problem, missing axis labels on the build server
alt text http://img687.imageshack.us/img687/5038/chartwithmissingaxislab.png

Here's how it's supposed to look with labels (taken on my local development machine)
alt text http://img683.imageshack.us/img683/1504/chartwithaxislabels.png

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

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

发布评论

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

评论(1

山田美奈子 2024-09-04 01:05:21

我使用在 Flex Coders archive< 中找到的有用信息使其正常工作/a>.

基本上,在 initalize 事件处理程序中,我添加了以下代码:

var ccClassFactory:ContextualClassFactory = new ContextualClassFactory(ChartAxisTextLabel);
ccClassFactory.moduleFactory=this.moduleFactory;

var hAxisRenderer:AxisRenderer = new AxisRenderer();
hAxisRenderer.axis = hAxis;
hAxisRenderer.labelRenderer=ccClassFactory;

var vAxisRenderer:AxisRenderer = new AxisRenderer();
vAxisRenderer.axis = vertAxis;
vAxisRenderer.labelRenderer=ccClassFactory;

lineChart.horizontalAxis=hAxis;
lineChart.verticalAxis=vertAxis;
lineChart.horizontalAxisRenderers = [ hAxisRenderer ];
lineChart.verticalAxisRenderers = [ vAxisRenderer ];

另外,我必须创建该类:

public class ChartAxisTextLabel extends Label
{
    public function ChartAxisTextLabel()
    {
            super();
    }

    override public function set data(value:Object):void
    {
        super.data = value;
        text = value.text;
    }
}

I got it working using the helpful information I found at the Flex Coders archive.

Basically, in an initalize event handler, I added the following code:

var ccClassFactory:ContextualClassFactory = new ContextualClassFactory(ChartAxisTextLabel);
ccClassFactory.moduleFactory=this.moduleFactory;

var hAxisRenderer:AxisRenderer = new AxisRenderer();
hAxisRenderer.axis = hAxis;
hAxisRenderer.labelRenderer=ccClassFactory;

var vAxisRenderer:AxisRenderer = new AxisRenderer();
vAxisRenderer.axis = vertAxis;
vAxisRenderer.labelRenderer=ccClassFactory;

lineChart.horizontalAxis=hAxis;
lineChart.verticalAxis=vertAxis;
lineChart.horizontalAxisRenderers = [ hAxisRenderer ];
lineChart.verticalAxisRenderers = [ vAxisRenderer ];

Also, I had to create the class:

public class ChartAxisTextLabel extends Label
{
    public function ChartAxisTextLabel()
    {
            super();
    }

    override public function set data(value:Object):void
    {
        super.data = value;
        text = value.text;
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文