1

我想在 Bootstrap div 中放置一个图表。我知道如何将图表放在示例 html 页面中(下面的 C# Highchart 代码):

    protected void Page_Load(object sender, EventArgs e)
    {
        DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
            .SetXAxis(new XAxis
            {
                Categories = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
            })
            .SetSeries(new Series
            {
                Data = new Data(new object[] { 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4 })
            });

        chart1.Text = chart.ToHtmlString();
    }

在 aspx 页面上:

<body>
<form id="form1" runat="server">
<div> asp:Literal id="chart1" runat="server" /asp:Literal 
</div>
</form>

使用 Bootstrap,我有很多 div,用 Javascript 代码创建的 HighCharts 完成(下面的 aspx 页面代码):

            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                       NAME OF THE CHART
                    </div>

                    <div class="panel-body">
                     <div class="flot-chart">
                      <div class="flot-chart-content" id="HighChart Chart Created by JavaScript Code" style=" height: 400px; margin: 0 auto">
                      </div>
                     </div>
                    </div               
                </div>                  
            </div>

所以我想知道是否有一个示例/方法可以在 Bootstrap div 上显示使用 C# 代码(使用 DotNet.HighCharts 参考)创建我的图表。

4

1 回答 1

0

So as nobody could answer my question, I ve found a solution myself:

I only use JavaScript and WebServices to make the HighCharts displayed on the website page.

It s no so difficult to use it, you only need to make the good JavaScript function to be able to use the HighCharts properly.

If you have some questions about how to do it, just tell me .

Thanks to anybody read this post anyway !!

Regards.

FB

于 2014-10-25T20:58:44.457 回答