Hi,
I'm building a survey management tool and I'm now in the phase of showing the survey result. Some of the survey questions have the matrix type, so I'm using a column radchart control within a datalist to show their results and the radchart consists of multiple series.
My aspx looks like the following
and my code behind page looks like this:
my problems are the following:
1) The legend take the value from XAxis DataLabelsColumn "OptionText" and I wanna show the series value "ColumnText"
2) the labels above the sries showed the YAxis value "RespondentCount" and I wanna show series value "ColumnText"
Any help please...
Thank's in advance..
I'm building a survey management tool and I'm now in the phase of showing the survey result. Some of the survey questions have the matrix type, so I'm using a column radchart control within a datalist to show their results and the radchart consists of multiple series.
My aspx looks like the following
<asp:DataList ID="ResultDataList" runat="server" Width="100%" > |
<ItemTemplate> |
<table width="100%"> |
<tr> |
<td> |
<%#Eval("Question")%> |
<asp:HiddenField ID="QuestionIDField" runat="server" Value='<%#Eval("QuestionID") %>' /> |
</td> |
</tr> |
<tr> |
<td > |
<telerik:RadChart ID="RadChart1" runat="server" Width="500" Height="250" ChartTitle-Visible="false" CreateImageMap="false" DataGroupColumn="ColumnText"> |
<PlotArea> |
<XAxis DataLabelsColumn="OptionText"> |
</XAxis> |
</PlotArea> |
</telerik:RadChart> |
</td> |
</tr> |
<tr><td><hr /></td></tr> |
</table> |
</ItemTemplate> |
</asp:DataList> |
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:SurveyDBConnectionString %>" |
SelectCommand="select optiontext,text,isnull((select COUNT(resultid) from SurveyResult where OptionID=SurveyOption.OptionID and ColumnID=ColumnOption.ColumnOptionID group by OptionID ),'0') as RespondentCount from SurveyOption,ColumnOption where SurveyOption.QuestionID=ColumnOption.QuestionID and SurveyOption.QuestionID= @QID"> |
<SelectParameters> |
<asp:Parameter Name="QID" /> |
</SelectParameters> |
</asp:SqlDataSource> |
Protected Sub ResultDataList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles ResultDataList.ItemDataBound |
If (Not e Is Nothing) Then |
Dim chart As RadChart = CType(e.Item.FindControl("RadChart1"), RadChart) |
Dim h As HiddenField = CType(e.Item.FindControl("QuestionIDField"), HiddenField) |
SqlDataSource2.SelectParameters(0).DefaultValue = h.Value |
chart.DataSource = SqlDataSource2.Select(DataSourceSelectArguments.Empty) |
chart.Legend.Appearance.GroupNameFormat = "ColumnText" |
chart.DataBind() |
End If |
End Sub |
1) The legend take the value from XAxis DataLabelsColumn "OptionText" and I wanna show the series value "ColumnText"
2) the labels above the sries showed the YAxis value "RespondentCount" and I wanna show series value "ColumnText"
Any help please...
Thank's in advance..