@{
    ViewData["Title"] = "资产负债表明细趋势图";
    Layout = "~/Pages/Shared/_MainLayout.cshtml";
    ViewBag.Nav = new string[] { "报表管理", "资产负债表", ViewBag.colname + " 趋势图" };
}

<div class="row">
    <div class="col-sm-12">
        @*<div class="ibox-content m-b-sm border-bottom">
                <form id="toolbar">
                    <div class="form-inline" style="line-height:40px;">
                        <div class="form-group">
                            <input id="start" class="form-control" name="start" type="text" style="width:120px;" value="@ViewBag.start" />
                            <input id="end" name="end" class="form-control" type="text" style="width:120px;" value="@ViewBag.end" />
                            <button type="button" class="btn btn-sm btn-primary" onclick="init();"><i class="fa fa-search"></i>&nbsp;查询</button>
                            <button id="btnexport" type="button" class="btn btn-sm btn-success" onclick="ExportXsl();">导出</button>
                        </div>
                    </div>
                </form>
            </div>*@
        <div class="ibox-content m-b-sm border-bottom">
            <div id="chart_content" style="height:600px;width:100%;">

            </div>
        </div>
    </div>
</div>

@section scripts{
    <script src="https://cdn.bootcss.com/echarts/3.6.2/echarts.min.js"></script>
    <script>
        var myChart;
        $(document).ready(function () {
            //laydate.render({ elem: '#start' });
            //laydate.render({ elem: '#end' });

            myChart = echarts.init(document.getElementById('chart_content'));
            init();
        })

        function init() {

            var strhead = '@ViewBag.head';
            var strval = '@ViewBag.vals';

            var arrhead = strhead.split(',');
            var arrval = strval.split(',');

            var option = {
                title: {
                    text: ''
                },
                tooltip: {},
                legend: {
                    data: ['环比%']
                },
                xAxis: {
                    data: arrhead
                },
                yAxis: {},
                series: [{
                    name: '金额',
                    type: 'bar',
                    barWidth: '30%',
                    data: arrval
                }]
            };

            myChart.setOption(option);

        }
    </script>
}

