How to bind data source to a chart control in visual studio 2015 using Syncfusion?Can anyone please provide asp.net code for it?
This is the code that I tried
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ChartDemo.WebForm1" %>
<%@ Register assembly="Syncfusion.EJ.Web" namespace="Syncfusion.JavaScript.Web" tagprefix="ej" %>
<%@ Register assembly="Syncfusion.EJ" namespace="Syncfusion.JavaScript.DataVisualization.Models" tagprefix="ej" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/ej/datavisualization/ej.chart.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jquery-1.10.2.min.js"></script>
<!-- Essential JS UI widget -->
<script src="http://cdn.syncfusion.com/13.1.0.21/js/web/ej.web.all.min.js"></script>
<!--Add Syncfusion Script Manager -->
<script>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ej:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" SeriesType="Column" XName="NetCurrentAssets" YName="NetDeferredTax">
<CommonSeriesOptions Type="Column" XName="NetCurrentAssets" YName="NetDeferredTax">
<CornerRadius Top="0" Bottom="0" Left="0" Right="0"></CornerRadius>
<Marker>
<DataLabel MaximumLabelWidth="0">
<Offset X="0" Y="0"></Offset>
</DataLabel>
</Marker>
</CommonSeriesOptions>
<Crosshair>
<Marker>
<DataLabel MaximumLabelWidth="0">
<Offset X="0" Y="0"></Offset>
</DataLabel>
</Marker>
<TrackballTooltipSettings>
<Border Color=""></Border>
</TrackballTooltipSettings>
</Crosshair>
<PrimaryXAxis DesiredIntervals="" MaximumLabelWidth="34" LabelIntersectAction="None">
<Title Offset="0"></Title>
</PrimaryXAxis>
<PrimaryYAxis DesiredIntervals="" MaximumLabelWidth="34" LabelIntersectAction="None">
<Title Offset="0"></Title>
</PrimaryYAxis>
<Title Offset="0"></Title>
<Legend Background="" Fill="">
<Size Width="" Height=""></Size>
</Legend>
<Zooming ToolbarItems="(Collection)"></Zooming>
<ExportSettings Angle="0"></ExportSettings>
</ej:Chart>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:newreporttoolConnectionString %>" SelectCommand="SELECT top 10 [NetCurrentAssets], [NetDeferredTax] FROM [Bsratios]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
And It is giving error Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Type 'System.Object' does not have a public property named 'Top'.
Source Error:
Line 27: <ej:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" SeriesType="Column" XName="NetCurrentAssets" YName="NetDeferredTax">
Line 28: <CommonSeriesOptions Type="Column" XName="NetCurrentAssets" YName="NetDeferredTax">
Line 29: <CornerRadius Top="0" Bottom="0" Left="0" Right="0"></CornerRadius>
Line 30:
Line 31: <Marker>
Source File: /WebForm1.aspx Line: 29
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0