Welcome Guest Search | Active Topics |

ASP.NET DataBinding
nolan
#1 Posted : Monday, November 05, 2012 9:44:44 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/5/2012(UTC)
Posts: 3

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi jqChart,

How can I bind the jqChart for ASP.NET to some data source?

Best,
Nolan
Ivan
#2 Posted : Monday, November 05, 2012 9:52:25 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Hi,

Binding jqChart to data source is pretty simple. You can take a look at this sample:

http://www.jqchart.com/SamplesAspNet

As you can see from the ASPX tab you need to create some data source (in the sample it is ObjectDataSource) and pass it to the jqChart with DataSourceID property. After that you can specify XValuesField and YValuesField of the series:

Code:
<Series>
            <jqChart:LineSeries XValuesField="ValueX" YValuesField="ValueY1" Title="Series 1">
                <Markers Visible="False" />
            </jqChart:LineSeries>
            <jqChart:LineSeries XValuesField="ValueX" YValuesField="ValueY2" Title="Series 2">
                <Markers Visible="False" />
            </jqChart:LineSeries>
        </Series>
Best,
Ivan Petrov
jqChart Inc.
1 user thanked Ivan for this useful post.
nolan on 11/5/2012(UTC)
nolan
#3 Posted : Monday, November 05, 2012 10:16:16 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/5/2012(UTC)
Posts: 3

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Ivan,

It is simple :) I was able to create a simple chart with data binding very easy.

Thanks,
Nolan
JonS
#4 Posted : Tuesday, January 08, 2013 8:44:36 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2013(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
I'm attempting to do something similar, and have run into a problem binding it to an SQLDataSource. I don't believe the problem is with the datasource, as it is correctly powering an ASP.net chart. It will also work if I manually add values, which leads me to believe my javascript and css files are set up correctly. Any ideas on what's going on?

Snippets of my chart code follow:

Code:


    <asp:SqlDataSource ID="dsSQLQuery" runat="server"
        ConnectionString="<%$ ConnectionStrings:SQL %>"
        ProviderName="<%$ ConnectionStrings:SQL.ProviderName %>"
        SelectCommand="SELECT [numViews], [supplementTitle] FROM [tblLessons] WHERE ([rmID] = @rmID)">

        <SelectParameters>
            <asp:ControlParameter ControlID="ddlRoadmaps"
                Name="rmID" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>

    </asp:SqlDataSource>
   
    <asp:Chart ID="chtViewsByLesson" runat="server" DataSourceID="dsSQLQuery"
        Width="500px">
        <Series>
            <asp:Series Name="Series1" XValueMember="supplementTitle"
                YValueMembers="numViews">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

        <jqChart:Chart ID="Chart1" runat="server" DataSourceID="dsSQLQuery">
            <Series>
                <jqChart:LineSeries XValuesField="supplementTitle" YValuesField="numViews">
                </jqChart:LineSeries>
            </Series>
        </jqChart:Chart>

Ivan
#5 Posted : Wednesday, January 09, 2013 9:09:52 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Hi,

We believe we found the issue. Please get this version:

www.jqchart.com/tests/jqChartASPNET_3_6_1_0.zip

and let us know if it is working property. The official fix will be available in a few days.
Best,
Ivan Petrov
jqChart Inc.
1 user thanked Ivan for this useful post.
JonS on 1/9/2013(UTC)
JonS
#6 Posted : Wednesday, January 09, 2013 3:21:48 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/8/2013(UTC)
Posts: 2

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Thank you so much Ivan! That looks like it did exactly what it was supposed to do. My chart is working as expected now.

I really appreciate the quick and helpful response. You guys do amazing work!
Dragan
#7 Posted : Thursday, January 10, 2013 7:47:05 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
The official fix (version 3.6.1.0) is ready.
http://www.jqchart.com/Download.aspx
Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.483 seconds.