Starting using HighCharts .Net :: Problem seeing charts...

Sep 6, 2012 at 3:07 PM
Edited Sep 6, 2012 at 3:08 PM

Hello!

I'm starting today using HighCharts .Net and having some troubles.

I'm using the exacte some dummy example given at documentation but the chart does not appear.

in aspx:

 

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" class="bd_tabs_main">
        <tr>
            <td class="fd_tit_tabs_main">
                <highchart:LineChart ID="hcVendas" runat="server" Width="350" Height="500"  />
            </td>
        </tr>
    </table>
</asp:Content>

 

in code behind:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Highchart.UI;
using Highchart.Core;
using System.Collections.ObjectModel;
using Highchart.Core.Data.Chart;

namespace GlobalChannelSite.Reports
{
    public partial class ReceivedSmsStatistics : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Defining Axis

            hcVendas.YAxis.Add(new YAxisItem { title = new Title("Faturamento") });
            hcVendas.XAxis.Add(new XAxisItem { categories = new[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });

            //New data collection
            var series = new Collection<Serie>();
            series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 } });

            //bind 
            hcVendas.DataSource = series;
            hcVendas.DataBind();

        }
    }
}

I add

 

<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script> 

 

to Default.Master head but with the same result

I only see the table moving if I'm change Height in highchart control...

Can you help me??

Thanks in advance

 

Height
Developer
Sep 6, 2012 at 3:32 PM

I think you might be missing the jquery items in your web.config. Anytime I have had this problem, it is because of that.

Ted Forsman

From: gelasio [email removed]
Sent: Thursday, September 06, 2012 7:08 AM
To: tforsman@ix.netcom.com
Subject: Starting using HighCharts .Net :: Problem seeing charts... [highcharts:394641]

From: gelasio

Hello!

I'm starting today using HighCharts .Net and having some troubles.

I'm using the exacte some dummy example given at documentation but the chart does not appear.

in aspx:

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" class="bd_tabs_main">
        <tr>
            <td class="fd_tit_tabs_main">
                <highchart:LineChart ID="hcVendas" runat="server" Width="350" Height="500"  />
            </td>
        </tr>
    </table>
</asp:Content>

in code behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Highchart.UI;
using Highchart.Core;
using System.Collections.ObjectModel;
using Highchart.Core.Data.Chart;
 
namespace GlobalChannelSite.Reports
{
    public partial class ReceivedSmsStatistics : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Defining Axis
 
            hcVendas.YAxis.Add(new YAxisItem { title = new Title("Faturamento") });
            hcVendas.XAxis.Add(new XAxisItem { categories = new[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });
 
            //New data collection
            var series = new Collection<Serie>();
            series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 } });
 
            //bind 
            hcVendas.DataSource = series;
            hcVendas.DataBind();
 
        }
    }
}

I add

<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script> 

to Default.Master head but with the same result

I only see the table moving if I'm change

Height

in highchart control...

Can you help me??

Thanks in advance

Height
Sep 6, 2012 at 3:43 PM

Hi!

In web.config I had a line in <pages>. It looks like this:

   <pages>
      <controls>
        <add namespace="IBFeditor" assembly="IBFeditor" tagPrefix="ibf"/>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
	<add tagPrefix="highchart" namespace="Highchart.UI" assembly="Highchart"/>
      </controls>
    </pages>

That is not the problem.

Any other suggestion?

Sep 7, 2012 at 10:42 AM

Anyone? =(

Developer
Sep 7, 2012 at 1:12 PM

Gelasio,

The other problem I have had is when I don’t include the following in my page. I use ASP.NET with code behind and a Master Page. The following line is in the <head></head> section of the Master Page. Try that. I hope this helps.

Ted

<!-- scripts obrigatórios -->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

<!-- fim dos scripts obrigatórios -->

From: gelasio [email removed]
Sent: Friday, September 07, 2012 2:42 AM
To: tforsman@ix.netcom.com
Subject: Re: Starting using HighCharts .Net :: Problem seeing charts... [highcharts:394641]

From: gelasio

Anyone? =(

Sep 7, 2012 at 2:32 PM

Thanks tjforsman you made my day ;)

Developer
Sep 7, 2012 at 6:31 PM

Gelasio,

You are welcome. I have received help from many on the project and am glad I can now finally help somebody else. Highcharts.net is fantastic.

tjforsman

From: gelasio [email removed]
Sent: Friday, September 07, 2012 6:32 AM
To: tforsman@ix.netcom.com
Subject: Re: Starting using HighCharts .Net :: Problem seeing charts... [highcharts:394641]

From: gelasio

Thanks tjforsman you made my day ;)

Jun 24, 2013 at 2:32 PM
Hi,

I got the Line Chart working. But I want a Column chart and I tried the code below for column chart. But it didn't work. Can you help me? What needs to be changed? Thanks in advance.

in apsx:
<highchart:ColumnChart ID="hcVendas" runat="server" Width="350" Height="500" />

in codebehind:

hcVendas.YAxis.Add(new YAxisItem { title = new Title("Faturamento") });
        hcVendas.XAxis.Add(new XAxisItem { categories = new[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });

        //New data collection
        var series = new Collection<Serie>();
        series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 } });
        series.Add(new Serie { data = new object[] { 420, 415, 426, 469, 294, 624, 127, 250, 431 } });

        //bind 
        hcVendas.DataSource = series;
        hcVendas.DataBind();
rams