5 Answers, 1 is accepted
Could you elaborate a little bit more on your specific scenario how radchart handles the scenario when there is no data available to display? By default when there is no series or empty series, only the RadChart.PlotArea.EmptySeriesMessage.TextBlock.Text message is displayed and not the axes or the axes' labels.
Greetings,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Hi Manuel
Whats happening is the empty series message is appearing, but then the x and y axes labels are also apperaring in the middle part of the plotarea, over the no data available text(that i set as the empty series message). Currently ive acheived this by setting the plotarea.visible to false. Im not sure if thats the best way to do it, because i also want to inform the user that no data is available hence the blank space in place of the plot area. I dont know if ive explained the scenario clearly enough.
Could you post the chart declaration here as we are unable to observe the described behavior with no / empty series like this:
<telerik:RadChart ID="RadChart2" runat="server"> |
<Series> |
</Series> |
<PlotArea> |
<XAxis> |
<AxisLabel TextBlock-Text="TEST"> |
</AxisLabel> |
</XAxis> |
<YAxis> |
<AxisLabel TextBlock-Text="TEST"> |
</AxisLabel> |
</YAxis> |
</PlotArea> |
</telerik:RadChart> |
Best wishes,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
<
radspl:RadSplitBar id="RadSplitBar1" runat="server"></radspl:RadSplitBar>
<radspl:RadPane id="GridViewRadPane" runat="server" UseEmbeddedScripts="False" width="100%" height="100%">
<div id="TabStripDiv" runat="server" style="width:99%; height:30px; position:static; top:1px; left:5px">
<radTS:RadTabStrip ID="RadTabStrip1" runat="server" Width="100%" MultiPageID="RadMultiPage1" SelectedIndex="0" Height="15px" style="position:absolute" Skin="Default" UseEmbeddedScripts="False">
<Tabs>
<radts:Tab ID="Tab1" Text="GridView" runat="server" ></radts:Tab>
<radts:Tab ID="Tab2" Text="Graph" runat="server"></radts:Tab>
</Tabs>
</radTS:RadTabStrip>
</div>
<div id="GridViewDiv" runat="server" style="width:99%; height:100%; position:relative; top:0px; left:3px">
<radTS:RadMultiPage ID="RadMultiPage1" runat="server" Width="99%" Height="100%" SelectedIndex="0" UseEmbeddedScripts="False">
<radTS:PageView ID="DataGridPageView" runat="server" Width="99%" Height="100%">
<asp:ObjectDataSource ID="TimeSheet_Object" runat="server" SelectMethod="GetTimeSheet" TypeName="SecureLayer" OnSelecting="TimeSheet_Object_Selecting" >
<SelectParameters>
<asp:ControlParameter ControlID="UserName_textbox" DefaultValue="none" Name="_UserName" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="StartDate_texBox" DefaultValue="none" Name="_StartDate" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="EndDate_textbox" DefaultValue="none" Name="_EndDate" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="TimeSheetGridView" DataSourceID="TimeSheet_Object" runat="server" AllowPaging="True" HorizontalAlign="Justify" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="EntryLogID" HeaderStyle-BackColor="#538CC3" OnSelectedIndexChanged="TimeSheetGridView_SelectedIndexChanged" CellPadding="4" ForeColor="#164C70" style="margin: 1px; border-right: #ffffff thin solid; border-top: #ffffff thin solid; border-left: #ffffff thin solid; border-bottom: #ffffff thin solid; font-size: 14px; font-family: Arial;" Width="99%" PageSize="15" OnDataBound="TimeSheetGridView_DataBound" CssClass="RadGrid">
<Columns>
<asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/arrow.PNG" UpdateImageUrl="~/arrow.PNG" >
<ItemStyle Width="3%" />
</asp:CommandField>
<asp:BoundField DataField="EntryLogID" HeaderText="EntryLogID" InsertVisible="False" ReadOnly="True" SortExpression="EntryLogID" Visible="False" >
<ItemStyle Width="50px" />
</asp:BoundField>
<asp:BoundField DataField="EntryDate" HeaderText="EntryDate" SortExpression="EntryDate" DataFormatString="{0:dd-MMM-yyyy}" HtmlEncode="False" >
<ItemStyle Width="150px" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" Font-Bold="True" Font-Names="Times New Roman" />
</asp:BoundField>
<asp:BoundField DataField="Name" HeaderText="Project Name" SortExpression="Name" >
<ItemStyle Width="200px" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" Font-Names="Times New Roman" />
</asp:BoundField>
<asp:BoundField DataField="Category Name" HeaderText="Category Name" SortExpression="Category Name" >
<ItemStyle Width="200px" HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" Font-Names="Times New Roman" />
</asp:BoundField>
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" >
<ItemStyle Width="300px" HorizontalAlign="Left" Wrap="True"/>
<HeaderStyle HorizontalAlign="Center" Font-Names="Times New Roman" />
</asp:BoundField>
<asp:BoundField DataField="Duration" HeaderText="Duration" SortExpression="Duration" >
<ItemStyle Width="6px" HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Center" Font-Names="Times New Roman" />
</asp:BoundField>
<asp:CheckBoxField DataField="Billable" HeaderText="Billable" SortExpression="Billable" >
<ItemStyle Width="3px" HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" Font-Names="Times New Roman" />
</asp:CheckBoxField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="False" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" CssClass="RadGridItem" Width="100%" />
<EditRowStyle BackColor="#2461BF" BorderStyle="Solid" Wrap="True" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="False" ForeColor="#333333" Width="100%" />
<PagerStyle BackColor="#164C70" ForeColor="White" HorizontalAlign="Center" CssClass="RadGridPager" />
<HeaderStyle BackColor="#164C70" Font-Bold="False" ForeColor="White" CssClass="RadGridHeader" />
<AlternatingRowStyle BackColor="White" CssClass="RadGridItem" />
<EmptyDataTemplate>
<span style="font-size:16pt; font-family: Arial"><strong>No Data Available</strong></span>
</EmptyDataTemplate>
<EmptyDataRowStyle BackColor="#164C70" ForeColor="White" />
</asp:GridView>
</radTS:PageView>
<radTS:PageView ID="GraphPageView" runat="server" Enabled="true" Visible="true" Width="99%">
<div id="Div1" style="background-color:#164C70; position:relative; left:3px; top:0px; width:95%; height:200px;" onclick="return GraphDiv_onclick()">
<radC:RadChart ID="RadChart1" runat="server" Palette="BabyBlue" DataSourceID="SummaryDS" Width="600px" Height="600px" SeriesPalette="Office2007">
<Series>
<radC:ChartSeries Name="Series 1">
<Appearance>
<LabelAppearance Visible="False">
</LabelAppearance>
<TextAppearance TextProperties-Color="Black" TextProperties-Font="Verdana, 8.25pt, style=Bold">
</TextAppearance>
</Appearance>
</radC:ChartSeries>
</Series>
<PlotArea>
<DataTable>
<Appearance RenderType="PlotAreaRelative" TextHorizontalAlign="Center" TextVerticalAlign="Middle">
</Appearance>
</DataTable>
<YAxis MaxValue="24" LogarithmBase="2" MaxItemsCount="24" VisibleValues="Positive" AutoScale="False" Visible="True">
<Appearance MajorTick-Cap="Flat" MajorTick-Color="Blue" MinorTick-Cap="Flat" MinorTick-Color="Red" MinorTick-Visible="False">
<TextAppearance TextProperties-Color="Gray">
</TextAppearance>
<MajorGridLines Color="144, 134, 134" PenStyle="Solid" />
<MinorGridLines PenStyle="Solid" Visible="False" />
</Appearance>
<AxisLabel>
<TextBlock Text=" Hours" Visible="True">
<Appearance TextProperties-Color="0, 0, 192" TextProperties-Font="Verdana, 12pt, style=Bold, Underline"></Appearance>
</TextBlock>
<Marker Visible="True">
<Appearance Border-Color="Red" Figure="Ellipse">
<FillStyle MainColor="Red" SecondColor="255, 128, 128">
</FillStyle>
</Appearance>
</Marker>
</AxisLabel>
<Items>
<radC:ChartAxisItem>
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="1">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="2">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="3">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="4">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="5">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="6">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="7">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="8">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="9">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="10">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="11">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="12">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="13">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="14">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="15">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="16">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="17">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="18">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="19">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="20">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="21">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="22">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="23">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="24">
</radC:ChartAxisItem>
</Items>
</YAxis>
<YAxis2 MinValue="1" MaxItemsCount="31">
<AxisLabel>
<TextBlock Text="Days" >
<Appearance Position-AlignedPosition ="topLeft"></Appearance>
</TextBlock>
</AxisLabel>
</YAxis2>
<XAxis AutoScale="False" VisibleValues="Positive" MaxItemsCount="30" MaxValue="30">
<Appearance MajorTick-Cap="Flat" MajorTick-Color="Black">
<TextAppearance TextProperties-Color="Gray">
</TextAppearance>
<MajorGridLines PenStyle="Solid" Cap="Flat" Visible="False" />
</Appearance>
<Items>
<radC:ChartAxisItem>
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="1">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="2">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="3">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="4">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="5">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="6">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="7">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="8">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="9">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="10">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="11">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="12">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="13">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="14">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="15">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="16">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="17">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="18">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="19">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="20">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="21">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="22">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="23">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="24">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="25">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="26">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="27">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="28">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="29">
</radC:ChartAxisItem>
<radC:ChartAxisItem Value="30">
</radC:ChartAxisItem>
</Items>
<AxisLabel>
<TextBlock Text="Month Days " Visible="True" >
<Appearance TextProperties-Color="0, 0, 192" TextProperties-Font="Verdana, 12pt, style=Bold, Underline" Position-AlignedPosition="BottomLeft" ></Appearance>
</TextBlock>
<Marker Visible="True" >
</Marker>
</AxisLabel>
</XAxis>
<Appearance SeriesPalette="Office2007" Dimensions-Margins="5%, 5%, 10%, 10%">
<FillStyle FillType="Solid" MainColor="">
</FillStyle>
</Appearance>
<EmptySeriesMessage>
<TextBlock Text="No Data Available"></TextBlock>
</EmptySeriesMessage>
</PlotArea>
<ChartTitle Visible="False">
<TextBlock Text="">
<Appearance TextProperties-Color="Black">
</Appearance>
</TextBlock>
<Appearance Border-Visible="False" Dimensions-Margins="1%, 10px, 10px, 7.6%">
<FillStyle MainColor="200, 255, 255, 255">
</FillStyle>
</Appearance>
</ChartTitle>
<Appearance Border-Color="White">
<FillStyle SecondColor="AliceBlue">
</FillStyle>
</Appearance>
<Legend Visible="False">
<Appearance Border-Visible="False" Dimensions-Margins="18%, 4%, 1px, 1px">
<ItemTextAppearance TextProperties-Color="Gray">
</ItemTextAppearance>
<FillStyle MainColor="200, 255, 255, 255">
</FillStyle>
</Appearance>
</Legend>
</radC:RadChart>
<asp:ObjectDataSource ID="SummaryDS" runat="server" SelectMethod="TimeSheetSummary"
TypeName="SecureLayer">
<SelectParameters>
<asp:ControlParameter ControlID="UserName_textbox" Name="_UserName" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="StartDate_texBox" Name="_StartDate" PropertyName="Text"
Type="DateTime" />
<asp:ControlParameter ControlID="EndDate_TextBox" Name="_EndDate" PropertyName="Text"
Type="DateTime" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
</radTS:PageView>
</radTS:RadMultiPage>
Unfortunately we were unable to run the provided source as you have not provided the code for the specified ObjectDataSource controls. Therefore we tried to reproduce the problem locally and have attached a sample runnable application that uses the latest version of RadChart for ASP.NET AJAX (2008.1.415) and binds the control to an ObjectDataSource.
Please review the ObjectDataSource code -- neither returning null or an empty IEnumerable object reproduces the behavior you are describing. We will be glad if you could modify this runnable application so we can observe the erroneous issue on our end.
All the best,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center