This is a migrated thread and some comments may be shown as answers.

Error when tyring to use scrolling

10 Answers 163 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
joni
Top achievements
Rank 1
joni asked on 30 May 2008, 03:09 PM
This is my first attempt at using the chart. It works fine until I set the ChartClientScrollMode to anything other than "None".  The error I get is 
 
Sys.Webforms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.

In my ascx page(it's in a user control) the RadChart is defined:

<

telerik:RadChart ID="RadChart1" runat="server" Height="500px" Width="800px">

</telerik:RadChart>


The initialization occurs in the code behind:

The datasource is populated with a dataset created from a storedproc.

RadChart1.DataSource = charts.SPDataSet;

ChartSeries series1 = new ChartSeries("PercentChange", ChartSeriesType.Line);

RadChart1.Series.Add(series1);

RadChart1.PlotArea.XAxis.LayoutMode =

ChartAxisLayoutMode.Between;

RadChart1.Series[0].DataYColumn =

"pctChange";

RadChart1.PlotArea.XAxis.DataLabelsColumn =

"NSTERRITORY";

RadChart1.ChartTitle.TextBlock.Text =

"Percent Change By Territory from Q4 '06 to Q4 '07";

RadChart1.AutoLayout =

true;

RadChart1.Legend.Visible =

false;

RadChart1.ClientSettings.EnableZoom =

false;

RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.

ChartClientScrollMode.Both;

RadChart1.ClientSettings.XScale = 4;

// bind to the datasource

RadChart1.DataBind();

I tried all values for the ChartClientScrollMode and get the same error (except when it is None).

The error occurs in the databinding event.  Is there something I've left out that should be there?

Thanks!

Edited to add: My Chart dll says it's version:  2.0.1.0 - when I first started using the chart I got an error message and it said to add this to my web config:

<

add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2008.1.515.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />


joni

10 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 02 Jun 2008, 12:49 PM
Hello Joni,

I am afraid we are not aware of such issue with RadChart. Can you send us a sample page, showing this? I tried with your code and the error did not appear. You can find attached my page.

Unfortunately, there is another issue with this page -- currently you cannot use XAxis.DataLabelsColumn property in this scenario. I have already notified our developers of this issue, so it will be fixed for the next release. Your Telerik points have been updated.

Kind regards,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joni
Top achievements
Rank 1
answered on 02 Jun 2008, 02:43 PM
Ves,
Hi - I was able to take your code and add in some features that I have on my page and recreate the issue. The issue seems to be when you have the chart on a user control and you insert that user control on a tab page.  It worked fine in the user control up until the point I put it on a tab page.  Here is the code I used - if you need the entire code to reproduce  - let me know.

Here is the main apx page with the tab page and user control on it:

<%

@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestChart._Default" %>

<%

@ Register Assembly="Telerik.Charting" Namespace="Telerik.Charting" TagPrefix="telerik" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%

@ Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<

html xmlns="http://www.w3.org/1999/xhtml">

<

head id="Head1" runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<telerik:RadTabStrip ID="RadTabStrip1" runat="server">

</telerik:RadTabStrip>

<telerik:RadMultiPage ID="RadMultiPage1" runat="server">

<telerik:RadPageView ID="RadPageView1" runat="server">

<asp:Panel ID="UCStandardPanel" runat="server">

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

</telerik:RadAjaxManager>

<uc1:WebUserControl1

ID="WebUserControl1" runat="server" />

</asp:Panel>

</telerik:RadPageView>

</telerik:RadMultiPage>

</form>

</

body>

</

html>

And here is the code for the user control:


<

asp:Panel ID="StandardPanel" runat="server" >

<div align="center">

<

telerik:RadChart ID="RadChart1" runat='server'>

</

telerik:RadChart>

</

div>

</

asp:Panel>

 

0
Giuseppe
Telerik team
answered on 04 Jun 2008, 02:13 PM
Hi joni,

Indeed we were able to reproduce the problem now and our developers reacted immediately to fix it. We have attached an unofficial custom build that should behave as expected. We have updated your Telerik points for the report.

Let us know how it goes.


Sincerely yours,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joni
Top achievements
Rank 1
answered on 04 Jun 2008, 04:02 PM

Manuel,
I applied the hot fix - and I had the scroll bar and zoom but as soon as I tried to scroll it broke.  So I tried my smaller application I had created from your code and it worked. 
The difference is that in my larger application I am using ajax. On the page with the chart I have a dropdown box with a type of graph to display. Because this is on a user control I'm using the ajax manager proxy. If I take out the entries in the proxy it works fine - here is the code:

<

telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy2" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="DropDownChartType">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="DropDownChartType" />

<telerik:AjaxUpdatedControl ControlID="RadChart1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</

telerik:RadAjaxManagerProxy>



Thanks!

joni
0
Giuseppe
Telerik team
answered on 06 Jun 2008, 07:40 AM
Hi joni,

Unfortunately we are unable to reproduce the erroneous behavior you are experiencing with AJAX. We have attached a sample application that follows your guidelines and works as expected.

Please review it and let us know how it goes.


Best wishes,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joni
Top achievements
Rank 1
answered on 06 Jun 2008, 02:42 PM
Manuel,
Hi - I loaded your code and I too was successful - however to simulate mine even more closely I added a selected_index change event to the dropdown list. When the event is fired on the server side that is when I load the chart - this broke the code. 
Here is the WebUserControl1.ascx code:


<telerik:RadChart ID="RadChart1" runat="server" Height="500px" Width="800px">

</telerik:RadChart>


<

telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy2" runat="server">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="DropDownList1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="DropDownList1" />

<telerik:AjaxUpdatedControl ControlID="RadChart1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</

telerik:RadAjaxManagerProxy>

<

asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"

onselectedindexchanged="DropDownList1_SelectedIndexChanged">

<asp:ListItem Text="Text1"></asp:ListItem>

<asp:ListItem Text="Text2"></asp:ListItem>

<asp:ListItem Text="Text3"></asp:ListItem>

</

asp:DropDownList>

And here is the code for the WebUserControl1.ascx.cs

protected

void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{

LoadChart();

}

private void LoadChart()

{

DataSet SPDataSet = new DataSet();

DataTable tbl = new DataTable();

DataColumn col = new DataColumn("pctChange");

DataColumn col1 = new DataColumn("pctChange2");

col.DataType =

typeof(int);

tbl.Columns.Add(col);

col1.DataType =

typeof(int);

tbl.Columns.Add(col1);

int size = 12;

int maxLen = size.ToString().Length;

for (int i = 1; i <= size; i++)

{

tbl.Rows.Add(

new object[] { i ,i+2});

}

SPDataSet.Tables.Add(tbl);

RadChart1.DataSource = SPDataSet;

ChartSeries series1 = new ChartSeries("PercentChange", ChartSeriesType.Line);

RadChart1.Series.Add(series1);

RadChart1.PlotArea.XAxis.LayoutMode =

ChartAxisLayoutMode.Between;

RadChart1.Series[0].DataYColumn =

"pctChange";

ChartSeries series2 = new ChartSeries("PercentChange2", ChartSeriesType.Line);

RadChart1.Series.Add(series2);

RadChart1.Series[1].DataYColumn =

"pctChange2";

RadChart1.ChartTitle.TextBlock.Text =

"Percent Change By Territory from Q4 '06 to Q4 '07";

RadChart1.AutoLayout =

true;

RadChart1.Legend.Visible =

false;

RadChart1.ClientSettings.EnableZoom =

true;

RadChart1.ClientSettings.ScrollMode = Telerik.Web.UI.

ChartClientScrollMode.XOnly;

RadChart1.ClientSettings.XScale = 4;

// bind to the datasource

RadChart1.DataBind();

}

Thanks for your continued help on this!

joni

0
Giuseppe
Telerik team
answered on 09 Jun 2008, 07:40 AM
Hello joni,

Unfortunately even with the mentioned changes applied, we are still unable to reproduce the problematic behavior. Please review the attached runnable modified application and let us know if we are missing something out. Also, could you elaborate a bit more on the error you are receiving when you try to apply the scrolling?


Kind regards,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joni
Top achievements
Rank 1
answered on 09 Jun 2008, 02:36 PM
Manuel,
Hi - I took your exact code and compared it to mine - one thing I noticed was that you are using version 2.0 and I'm using 3.5. With your exact code I created another new project and again it failed (mine was 3.5 again).  I'm using IE 6.0.2900 - I tried it in Firefox and it worked.  I have not tried creating a version 2.0 and trying with IE  6 - I will try that.
The error I'm getting is:

"A runtime error has occurred. Do you wish to debug?"
Line 311
Error:'this._chunkMatrix[...]' is null or not an object.


Edited to add:  I just created a version 2.0 project with your code and it worked in IE 6 - so it seems the problem is in version 3.5 with IE6.

Edited to add: I just tried to convert my original project (not just this small subset) to 2.0 - I got the same error -so I created a whole new 2.0 project and copied all my code into it - it now works.
Something I noticed - it works with the YOnly - but the XOnly is the one that gets that error message above.

Thanks,
joni

0
Giuseppe
Telerik team
answered on 10 Jun 2008, 10:02 AM
Hello joni,

Thank you for the clarification. We have attached an unofficial custom build that should behave as expected in the described scenario (IE6 and .Net 3.5).

Let us know how it goes.


Best wishes,
Manuel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joni
Top achievements
Rank 1
answered on 10 Jun 2008, 01:42 PM
Manuel,
YEAH!!! It's working now !! Thanks so much for your fast response to all my threads - keep up the great work!! Doing a happy dance!

joni
Tags
Chart (Obsolete)
Asked by
joni
Top achievements
Rank 1
Answers by
Ves
Telerik team
joni
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or