<%@ Page Title="" Language="C#" MasterPageFile="~/bps/basic.Master" AutoEventWireup="true" CodeBehind="material_chart.aspx.cs" Inherits="bps.bps.material_chart" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

       <script src="../javascript/echarts/echarts.min_common.js"></script> 
             <script src="../javascript/echarts/chalk.js"></script>
             <script src="../javascript/echarts/MyEcharts.js"></script>
             <script src="../javascript/echarts/WapCharts.js"></script>



    <script src="../UserControl/mat_js.aspx?index=2&id=<%=id %>"></script>


      <div id="div_trending" style="width:950px; height:450px;  ">
            <img src="images/loading.gif"  id="img_trending"/> 
       </div>


                                
     <table id="tbl_data" class="table table-hover">
    <tr>
        <th width="200px">日期</th>
        <th width="150px">价格</th>
         <th width="500px">公司名称</th>
        <th></th>
    </tr> 
    </table>




    <script>

        //2    
        $.ajax({
            url: "ajax/data.aspx",
            data: { pid: <%=id%> },
            cache: true,
            dataType: 'json',
            success: function (data) {
                if(data=="")
                {
                    $("#img_trending").hide();
                    $("#tbl_data").hide();
                    return;
                }
                var tr_data = "";
                $.each(data, function (i, item) {
                    tr_data += "<tr><td>" + item.name + "</td><td>" + item.value + "</td><td>"+item.group+"</td></tr>";
                })

                $("#tbl_data").append(tr_data);
              

                
                  /*
                var options = ECharts.Bars(data, name, false, false, "line");
                options.legend.show = false; 
                  Draw(options,"div_trending");
                */
             
              
                DrawBars(data, "div_trending"); 
             
                $("#img_trending").hide();

            }
        });


    </script>

</asp:Content>
