首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Fusion Chart交换

Fusion Chart交换
EN

Stack Overflow用户
提问于 2013-07-17 22:31:53
回答 1查看 206关注 0票数 0

我尝试过做一个熔合图交换,但是asp不喜欢这样做。因此,下一个最好的方法是渲染融合图表,然后使用onmousedown将图表替换为图像。但这并不能很好地工作。我尝试在代码周围添加div并使用id,但交换不起作用。我在document.popChartDiv.src中使用了'popChartDiv‘,但是这个ID调用了Literal3的呈现。我不确定如何使用下面的两个div (testimage.png和tstiage1.png)来切换Literal3。似乎图表是焦点,图像无法覆盖图表。我也尝试过使用z-index,但不起作用。所以我被卡住了。

代码语言:javascript
复制
<div style="width:798px; margin-left:auto; margin-right:auto; height:250px; float:left; overflow:hidden;" id="popChartDiv">
    <script src="../../Dashboard/Charts/FusionCharts.js" type="text/javascript"></script>
    <div id="popChartContainer"></div>
    <asp:Literal ID="Literal3" Visible="true" runat="server"></asp:Literal>
         <div id="line3ChartContainer"></div>
         <asp:Literal ID="Literal9" Visible="true" runat="server"></asp:Literal>
         <img src="/images/testimage.png" width="798" height="250" name="swap"/>
</div>
<div style="width:38px; height:250px; float:left;">
    <img src="../../images/labortab.png" style="float:left; width:38px; height:125px;" id="labor" onmousedown="document.swap.src='/images/testimage.png';"/>
    <img src="../../images/odctab.png" style="float:left; width:38px; height:125px;" id="odc" onmousedown="document.swap.src='/images/testimage1.png';"/> 
    <script type="text/javascript">
        $('#labor').hover(function () {
            $(this).attr('src', '/images/labortabhover.png');
        }, function () {
            $(this).attr('src', '/images/labortab.png');
        });

        $('#odc').hover(function () {
            $(this).attr('src', '/images/odctabhover.png');
        }, function () {
            $(this).attr('src', '/images/odctab.png');
        });


        </script>
</div>
EN

回答 1

Stack Overflow用户

发布于 2013-07-18 03:07:29

如果要呈现基于Flash的图表,可能是窗口模式(wMode)设置为window。有一个Adobe help article on SWF stacking order声明,当窗口模式参数设置为window时,将忽略SWF对象的z索引。

在纯ASP.NET (C#)中,如果您使用的是RenderChart方法,那么将第九个参数设置为true (或false)应该会对您有所帮助。请参阅creating first chart using C# documentation article of FusionCharts中的相关章节。

如果您更喜欢使用JavaScript,您可以尝试在图表上调用setTransparent(false);,将wMode设置为不透明或透明。

假设您的图表id为line3Chart,代码将为

代码语言:javascript
复制
<script type="text/javascript">
    // Add this code snippet. Make sure to replace
    // "line3Chart with correct chart id
    FusionCharts("line3Chart").setTransparent(false);

    $('#labor').hover(function () {
        $(this).attr('src', '/images/labortabhover.png');
    }, function () {
        $(this).attr('src', '/images/labortab.png');
    });

    $('#odc').hover(function () {
        $(this).attr('src', '/images/odctabhover.png');
    }, function () {
        $(this).attr('src', '/images/odctab.png');
    });
</script>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17702607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档