connect AdventureWorks2012 db to Telerik UI webapp.
How can I connect some data to a chart?
I m readin the tutorials, but now sure how to synch
then grab data and drop evrything in the chart.
1 Answer, 1 is accepted
0
Vessy
Telerik team
answered on 30 Jun 2020, 12:15 PM
Hi Riccardo,
In order to bind the chart, you have to configure its data filed-related properties (with the names of te columns holding the data) and set the Datasource / Datasource Id of the control.
<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"SelectCommand="SELECT [Year], [Value] FROM [Data] WHERE ([Subcategory_Id] = 1)"></asp:SqlDataSource><telerik:RadHtmlChartrunat="server"ID="RadHtmlChart1"DataSourceID="SqlDataSource1"><PlotArea><Series><telerik:ColumnSeriesDataFieldY="Value"Name="Electricity Consumption"></telerik:ColumnSeries></Series><XAxisDataLabelsField="Year"><LabelsAppearanceRotationAngle="75" /><TitleAppearanceText="Year" /></XAxis><YAxis><TitleAppearanceText="MWh" /></YAxis></PlotArea><Legend><AppearanceVisible="false" /></Legend><ChartTitleText="Electricity Consumption"></ChartTitle></telerik:RadHtmlChart>
Regards,
Vessy
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.