I bound the Datasource with 3 columns to Bar chart.
Data Source
----------------
tempID col_Name Total
---------------------------------
10 test1 100
20 test2 200
I bound this Data Source to Bar chart. I display BarChart using 'col_Name' and 'Count'. Now I would like to pass tempID as a parameter to Drill down. How can I do this? I don't see any examples online.
Here is my code.
<telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="800px" Height="500px"
Skin="Metro"
<PlotArea>
<Appearance>
<FillStyle BackgroundColor="Transparent" />
</Appearance>
<Series>
<telerik:BarSeries Name="Total" DataFieldY="count">
<TooltipsAppearance Color="White" DataFormatString="{0}"></TooltipsAppearance>
<LabelsAppearance Visible="true">
</LabelsAppearance>
</telerik:BarSeries>
</Series>
<XAxis DataLabelsField="col_name">
</XAxis>
<YAxis>
<LabelsAppearance DataFormatString="{0}">
</LabelsAppearance>
</YAxis>
</PlotArea>
<Legend>
<Appearance Position="Bottom">
</Appearance>
</Legend>
<ChartTitle Text="Total">
</ChartTitle>
</telerik:RadHtmlChart>
Code behind
-----------------------------------
Data Source
----------------
tempID col_Name Total
---------------------------------
10 test1 100
20 test2 200
I bound this Data Source to Bar chart. I display BarChart using 'col_Name' and 'Count'. Now I would like to pass tempID as a parameter to Drill down. How can I do this? I don't see any examples online.
Here is my code.
<telerik:RadCodeBlock ID="codeBlock" runat="server"> <script type="text/javascript"> function OnClientSeriesClicked(sender, args) { if (args.get_seriesName() != "Months") $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(args.get_category()); } </script><telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="800px" Height="500px"
Skin="Metro"
OnClientSeriesClicked="OnClientSeriesClicked"><PlotArea>
<Appearance>
<FillStyle BackgroundColor="Transparent" />
</Appearance>
<Series>
<telerik:BarSeries Name="Total" DataFieldY="count">
<TooltipsAppearance Color="White" DataFormatString="{0}"></TooltipsAppearance>
<LabelsAppearance Visible="true">
</LabelsAppearance>
</telerik:BarSeries>
</Series>
<XAxis DataLabelsField="col_name">
</XAxis>
<YAxis>
<LabelsAppearance DataFormatString="{0}">
</LabelsAppearance>
</YAxis>
</PlotArea>
<Legend>
<Appearance Position="Bottom">
</Appearance>
</Legend>
<ChartTitle Text="Total">
</ChartTitle>
</telerik:RadHtmlChart>
Code behind
-----------------------------------
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
myDataTable4 = BL.GetSummaryByID(tempID);
RadHtmlChart1.PlotArea.XAxis.DataLabelsField = "Quarter";
RadHtmlChart1.PlotArea.Series[0].DataFieldY = "Rev";
RadHtmlChart1.PlotArea.Series[0].Name = "Quarters";
RadHtmlChart1.DataSource = myDataTable4;
RadHtmlChart1.DataBind(); }