or
Hello Telerik,
Please see this code here:.
01.Dim HBH_Chart As New RadHtmlChart02. HBH_Chart.ID = "HBH_Chart"03. HBH_Chart.Width = Unit.Pixel(500)04. HBH_Chart.Height = Unit.Pixel(500)05. HBH_Chart.Legend.Appearance.Position = HtmlChart.ChartLegendPosition.Right06. 07. Dim HBHSeries As New PieSeries08. HBHSeries.Name = "HBH1"09. HBHSeries.TooltipsAppearance.DataFormatString = "{0}"10. HBHSeries.LabelsAppearance.Visible = True11. 12. For Each row As DataRow In dataSet.Rows13. Dim item As New SeriesItem14. item.YValue = row.Field(Of Integer)("AantalClienten")15. item.Name = row.Field(Of String)("Naam")16. item.BackgroundColor = System.Drawing.ColorTranslator.FromHtml(row.Field(Of String)("Kleur"))17. Next18. 19. HBH_Chart.PlotArea.Series.Clear()20. HBH_Chart.PlotArea.Series.Add(HBHSeries)21. HBH_Chart.PlotArea.XAxis.DataLabelsField = "Naam"22. HBH_Chart.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0}"23. 24. HtmlChartHolder.Controls.Clear()25. HtmlChartHolder.Controls.Add(HBH_Chart)I try to create a PieChart dynamically. But the only thing that I see is that it takes up it's space in the page (i.e. the placeholder is filled). But the actual chart is not visible. It's see as a white rectangle. What am I missing here?
Thanks a lot for your answer,
Best regards,
Francois
| <telerik:RadGrid |
| ID="RadGridResults" |
| runat="server" AllowSorting="True" |
| AutoGenerateColumns="False" GridLines="None" |
| AllowMultiRowSelection="True" Skin="Web20" Font-Bold="False" |
| Font-Italic="False" Font-Names="Verdana" Font-Overline="False" |
| Font-Strikeout="False" Font-Underline="False" |
| OnItemCommand="RadGridResults_ItemCommand"> |
| <MasterTableView Font-Bold="False" Font-Italic="False" Font-Names="Verdana" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Font-Size="11px" OnItemCommand="RadGridProduct_ItemCommand"> |
| <rowindicatorcolumn> |
| <HeaderStyle Width="20px" /> |
| </rowindicatorcolumn> |
| <expandcollapsecolumn> |
| <HeaderStyle Width="20px" /> |
| </expandcollapsecolumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Sequence" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridClientSelectColumn UniqueName="colSelect" Display="True"> |
| <HeaderStyle Width="40px" Font-Bold="False" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| HorizontalAlign="Center" Wrap="True" /> |
| <ItemStyle BorderStyle="None" Font-Bold="False" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| HorizontalAlign="Center" Wrap="True" /> |
| </telerik:GridClientSelectColumn> |
| <telerik:GridBoundColumn DataField="Location" HeaderText="Location" |
| SortExpression="Location" UniqueName="colLocation"> |
| <HeaderStyle Width="110px" Font-Bold="True" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| ForeColor="White" Wrap="True" /> |
| <ItemStyle BorderStyle="None" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Products" HeaderText="PRODUCT" |
| SortExpression="Product" UniqueName="colProduct"> |
| <HeaderStyle Width="100px" Font-Bold="True" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| ForeColor="White" Wrap="True" /> |
| <ItemStyle BorderStyle="None" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Sequence" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridButtonColumn |
| DataTextField="CourseName" |
| HeaderText="COURSE NAME" |
| SortExpression="CourseName" |
| Text="Button" |
| UniqueName="colCourseName"> |
| <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" |
| Font-Strikeout="False" Font-Underline="False" ForeColor="White" Width="260px" |
| Wrap="True" /> |
| <ItemStyle BorderStyle="None" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="StartDate" HeaderText="START DATE" |
| SortExpression="StartDate" UniqueName="colStartDate" |
| DataFormatString="{0:M/dd/yyyy}"> |
| <HeaderStyle Width="130px" Font-Bold="True" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| ForeColor="White" Wrap="True" /> |
| <ItemStyle BorderStyle="None" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="TotalAvailSeats" HeaderText="SEATS" |
| SortExpression="TotalAvailSeats" UniqueName="colTotalAvailSeats"> |
| <HeaderStyle Width="90px" Font-Bold="True" |
| HorizontalAlign="Center" Font-Italic="False" Font-Overline="False" |
| Font-Strikeout="False" Font-Underline="False" ForeColor="White" Wrap="True" /> |
| <ItemStyle BorderStyle="None" HorizontalAlign="Center" /> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" |
| Font-Strikeout="False" Font-Underline="False" Wrap="True" /> |
| <AlternatingItemStyle Font-Bold="False" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| Wrap="True" /> |
| </MasterTableView> |
| <SelectedItemStyle Font-Bold="True" ForeColor="Maroon" Font-Italic="False" |
| Font-Overline="False" Font-Strikeout="False" Font-Underline="False" |
| Wrap="True" BackColor="Silver" /> |
| <ClientSettings EnableRowHoverStyle="False" > |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
<telerik:RadGrid ID="rdTicketGrid" runat="server" Width="70%" AllowAutomaticUpdates="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowSorting="false" OnNeedDataSource="rdTicketGrid_NeedDataSource" AutoGenerateColumns="false" ShowFooter="true" OnInsertCommand="rdTicketGrid_InsertCommand" OnUpdateCommand="rdTicketGrid_UpdateCommand" OnItemCreated="rdTicketGrid_ItemCreated" OnDeleteCommand="rdTicketGrid_DeleteCommand" OnItemDataBound="rdTicketGrid_ItemDataBound"> <PagerStyle Mode="NextPrevAndNumeric" /> <MasterTableView DataKeyNames="TicketEntryID" CommandItemDisplay="Top" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="TicketEntryID" UniqueName="TicketEntryID" Display="false"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NumOfTickets" HeaderText="Number of Tickets"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NumberTicketsInSet" HeaderText="Number of Tickets per Set"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PriceOfTickets" HeaderText="Price of Tickets" DataFormatString="{0:C}"></telerik:GridBoundColumn> <telerik:GridCalculatedColumn HeaderText="Total Amount" UniqueName="TotalSetAmount" DataType="System.Double" DataFormatString="{0:C}" DataFields="NumOfTickets, NumberTicketsInSet, PriceOfTickets" Expression="{0}/{1}*{2}" FooterText="Total: " Aggregate="Sum" FooterAggregateFormatString="{0:C}"> </telerik:GridCalculatedColumn> <telerik:GridButtonColumn ConfirmText="Delete this ticket entry?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" /> </Columns> <EditFormSettings> <EditColumn ButtonType="ImageButton"></EditColumn> </EditFormSettings> </MasterTableView> <ClientSettings> <ClientEvents OnRowDblClick="rowDblClick" /> </ClientSettings> </telerik:RadGrid> <telerik:RadInputManager runat="server" ID="rdInputMgr" Enabled="true"> <telerik:NumericTextBoxSetting BehaviorID="TicketEntryIDTBSetting" Type="Number" AllowRounding="false" DecimalDigits="0"></telerik:NumericTextBoxSetting> <telerik:NumericTextBoxSetting BehaviorID="NumTicketsTBSetting" Type="Number" AllowRounding="false" DecimalDigits="0"></telerik:NumericTextBoxSetting> <telerik:NumericTextBoxSetting BehaviorID="PriceTicketsTBSetting" Type="Currency" AllowRounding="true" DecimalDigits="0"></telerik:NumericTextBoxSetting> <telerik:NumericTextBoxSetting BehaviorID="NumberTicketsInSetTBSetting" Type="Number" AllowRounding="true" DecimalDigits="0"></telerik:NumericTextBoxSetting> </telerik:RadInputManager>