or
Can we programatically add a TextBlock to a ChartTitle?
The reason is to display a multiline title, with a different style applied to each line so that I could display something like,
MAIN TITLE
Sub Title
Where the font size of "Sub Title" is smaller than "MAIN TITLE". I tried declaring new textblocks separately, then adding them to a charttitle, but it gives me a null object error when creating the textblock like,
TextBlock newBlock1 = new TextBlock(chartName);<telerik:RadChart ID="RadChartCategory" runat="server" DataSourceID="dsChartData" Width="950" Height="650" Skin="Vista"> <PlotArea> <YAxis> <Appearance CustomFormat="#,#"> </Appearance> </YAxis> <XAxis DataLabelsColumn="StringDate" LabelStep="4"> </XAxis> </PlotArea> <Series> <telerik:ChartSeries DataYColumn="Scenario1" DefaultLabelValue="" Name="Scenario 1" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Scenario2" DefaultLabelValue="" Name="Scenario 2" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Scenario3" DefaultLabelValue="" Name="Scenario 3" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Theoretical" DefaultLabelValue="" Name="Theoretical Capacity" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="NetEffective" DefaultLabelValue="" Name="Net Effective Capacity" Type="Line"> </telerik:ChartSeries> </Series> <ChartTitle> <TextBlock Text="Labour Demand"> </TextBlock> </ChartTitle></telerik:RadChart>Protected Sub RadComboBoxCategory_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBoxCategory.SelectedIndexChanged RadChartCategory.ChartTitle.TextBlock.Text = "Labour Demand - " & RadComboBoxCategory.SelectedItem.TextEnd Sub'Now populate the Managers Drop down rsMain = GeneralDataMethod.GetAllApprovedManagers While rsMain.Read cboManager.Items.Add(New RadComboBoxItem(rsMain("Manager"), rsMain("ManagerID"))) End While cboManager.Items.Insert(0, New RadComboBoxItem("- Please select -", ""))function sizeSplitter(sender, args) { var w = browserWidth() - 10; var h = browserHeight() - 200; alert('height=' + h + ' width=' + w); sender.get_element().style.height = h; sender.get_element().style.width = w; }
