Hi all,
My problem is this: when I move a working radChart to a master/content page scenario the chart shows me the message 'there is no or empty series'. The same code works ok when I place it in a regular aspx page. I tried adding the RadScriptManager to the masterpage but that didn't work. I went through this forum and found a lot of posts on the masterpage problem but no solution to my problem, unfortunately. Here is the code
aspx page
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/masterpages/ControlHolder.master" CodeBehind="test2.aspx.cs" Inherits="TestLme2" %>
<%@ MasterType virtualpath="~/masterpages/ControlHolder.Master" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Charting" tagprefix="telerik" %>
<
asp:Content
ID
=
"ContentMain"
ContentPlaceHolderID
=
"cntControl"
Runat
=
"Server"
>
<
telerik:RadChart
ID
=
"radChart1"
runat
=
"server"
Width
=
"700px"
AutoLayout
=
"True"
Skin
=
"Default2006"
>
<
Series
>
<
telerik:ChartSeries
Name
=
"Series 1"
>
<
Appearance
>
<
FillStyle
MainColor
=
"150, 150, 150"
SecondColor
=
"194, 194, 194"
>
</
FillStyle
>
<
Border
Color
=
"Silver"
/>
</
Appearance
>
</
telerik:ChartSeries
>
<
telerik:ChartSeries
Name
=
"Series 2"
>
<
Appearance
>
<
FillStyle
MainColor
=
"215, 215, 214"
SecondColor
=
"241, 241, 241"
>
</
FillStyle
>
<
Border
Color
=
"Silver"
/>
</
Appearance
>
</
telerik:ChartSeries
>
</
Series
>
<
PlotArea
>
<
XAxis
>
<
Appearance
Color
=
"Silver"
MajorTick-Color
=
"Silver"
>
<
MajorGridLines
Color
=
"Silver"
/>
</
Appearance
>
</
XAxis
>
<
YAxis
>
<
Appearance
Color
=
"Silver"
MajorTick-Color
=
"Silver"
MinorTick-Color
=
"Silver"
>
<
MajorGridLines
Color
=
"Silver"
/>
<
MinorGridLines
Color
=
"224, 224, 224"
/>
</
Appearance
>
</
YAxis
>
<
Appearance
Dimensions-Margins
=
"18%, 22%, 12%, 10%"
>
<
FillStyle
MainColor
=
"White"
SecondColor
=
"White"
FillType
=
"Solid"
>
</
FillStyle
>
<
Border
Color
=
"Silver"
/>
</
Appearance
>
</
PlotArea
>
<
Appearance
>
<
FillStyle
MainColor
=
"WhiteSmoke"
>
</
FillStyle
>
<
Border
Color
=
"Silver"
/>
</
Appearance
>
<
ChartTitle
>
<
Appearance
Position-AlignedPosition
=
"Top"
>
</
Appearance
>
<
TextBlock
>
<
Appearance
TextProperties-Color
=
"Gray"
>
</
Appearance
>
</
TextBlock
>
</
ChartTitle
>
<
Legend
>
<
Appearance
Dimensions-Margins
=
"18%, 1%, 1px, 1px"
>
<
Border
Color
=
"Silver"
/>
</
Appearance
>
</
Legend
>
</
telerik:RadChart
>
<
br
/>
<
br
/>
</
asp:Content
>
and the aspx.cs page:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable tbl = new DataTable();
DataColumn col = new DataColumn("Value");
col.DataType = typeof(int);
tbl.Columns.Add(col);
col = new DataColumn("Date");
col.DataType = typeof(double);
tbl.Columns.Add(col);
tbl.Rows.Add(new object[] { 5, DateTime.Today.ToOADate() });
tbl.Rows.Add(new object[] { 4, DateTime.Today.AddDays(1).ToOADate() });
tbl.Rows.Add(new object[] { 3, DateTime.Today.AddDays(2).ToOADate() });
tbl.Rows.Add(new object[] { 6, DateTime.Today.AddDays(3).ToOADate() });
tbl.Rows.Add(new object[] { 3, DateTime.Today.AddDays(4).ToOADate() });
tbl.Rows.Add(new object[] { 6, DateTime.Today.AddDays(5).ToOADate() });
ChartSeries ser = new ChartSeries("Value");
ser.DataYColumn = "Value";
ser.DataXColumn = "Date";
radChart1.Series.Add(ser);
radChart1.PlotArea.XAxis.IsZeroBased = false;
radChart1.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortDate;
radChart1.DataSource = tbl;
radChart1.DataBind();
}
}
Anyone have any ideas why this is happening?
Thanks,
Peter