Hi Cory,
Thanks for contacting Syncfusion support. We have analyzed your query. Currently we are not having support for binding 2 different SQL datasources to a single chart. But we can bind the table which containing multiple columns as the datasource for the chart and we can use these different column values for series. Please find the below code example.
[ASPX]
<asp:SqlDataSource ID="SqlData" runat="server"
ConnectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\Incident\Samples\17-5-16\ASP\WebApplication2\WebApplication2\App_Data\Windowsformdata.mdf;Integrated Security=True;Connect Timeout=30"
SelectCommand="SELECT * FROM [table2]">
</asp:SqlDataSource> |
In the above code, we have get the data from “table2”. Table2 is containing 3 columns(x,y,y1).
<ej:Chart runat="server" DataSourceID="SqlData" XName="x" YName="y" ID="ChartSample">
<PrimaryXAxis ValueType="Category" LabelPlacement="BetweenTicks" IntervalType="Days" />
<Series>
<ej:Series XName="x" YName="y" Type="Column">
<Tooltip Visible="true"></Tooltip>
</ej:Series>
<ej:Series XName="x" YName="y1" Type="Column">
<Tooltip Visible="true"></Tooltip>
</ej:Series>
</Series>
</ej:Chart> |
In the above code, we have bound the “table2” as datasource for the chart using its ID in “DataSourceID”. For the first series we have bound x as xname and y as yname and for the second series we bound x as xname and y1 as yname. Now the chart will render like below.
In the below link, we have attached sample for your reference.
Regards,
Sanjith.