highchart曲线在火狐里面可以,在ie和360中不显示,求高人指点。

xxdd 发布于 2013/05/15 15:56
阅读 886
收藏 0

火狐里面显示为

aspx中的代码为

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<html>
<head runat="server">
</head>
<body>
   <form id="form1" runat="server">
    <script type="text/javascript" src="Scripts/jquery.min.js"></script>
    <script src="Scripts/highcharts.js"></script>
    <script src="Scripts/exporting.js"></script>
     <script type="text/javascript" >
           $(btclick=function() {
                $('#divChart1').highcharts({
                    chart: {
                        type: 'spline'
                    },
                    title: {
                        text: '历史曲线'
                    },
                    xAxis: {
                        type: 'datetime',
                        categories: <%=XAxisCategories%> , //X轴的坐标值
                    },
                    yAxis: {
                        title: {
                            text: '数值'
                        },
                        min: 0,
                        minorGridLineWidth: 0,
                        gridLineWidth: 0,
                        alternateGridColor: null,
                    },
                    plotOptions: {
                        spline: {
                            lineWidth: 4,
                            states: {
                                hover: {
                                    lineWidth: 5
                                }
                            },
                            marker: {
                                enabled: false
                            },
                        }
                    },
                    series:<%=seriesData.ToString() %>,
                    navigation: {
                        menuItemStyle: {
                            fontSize: '10px'
                        }
                    }
                });
            })
            </script>
         <div  id="divChart1" style="border-style: solid; border-color: inherit; border-width: 1px;
        float:left; width:75%; height:100%; background-image: url('Images/lishi.bmp');">
        </div>
        <div>
         <asp:button id="ButtonQT" runat="server" width="80px" Text="查询" onclick="ButtonQT_Click"></asp:button>
        </div>
        </form>
</body>
</html>


.cs中的代码为

using System;
using SYWeb;
using System.Text;

public partial class test : System.Web.UI.Page
{
    public string XAxisCategories = ""; //X轴
    public StringBuilder seriesData = new StringBuilder();
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void ButtonQT_Click(object sender, EventArgs e)
    {
        XAxisCategories = "['05-15 10-00','05-15 10-15','05-15 13-30','05-15 13-45','05-15 14-00','05-15 14-15']";
        seriesData.Append("[{name: '");
        seriesData.Append(" ");
        seriesData.Append("',type: 'spline',data: [105,101,110,106,102,110]}]");
        ButtonQT.Attributes.Add("onclick", "return btclick()");
    }
}

加载中
0
xxdd
xxdd
知道原因了,谢谢大家关心。
0
JqbR001
JqbR001
什么原因⊙ω⊙
xxdd
xxdd
JS写的有问题。
返回顶部
顶部