Welcome Guest Search | Active Topics |

Multiple Series with different number of x-values
tlewi2
#1 Posted : Monday, December 2, 2013 1:29:56 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Is there a way to have one series with many x,y data points and another series with just a few x,y data points displayed on the same chart?
Ivan
#2 Posted : Monday, December 2, 2013 1:38:24 PM(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)
This shouldn't be a problem. Do you have any issues?
Best,
Ivan Petrov
jqChart Inc.
tlewi2
#3 Posted : Monday, December 2, 2013 1:46:43 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
I'm not sure how to bind the data to the chart using two different data sources (one for each series).
Ivan
#4 Posted : Monday, December 2, 2013 2:29:32 PM(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)
Currently, you can achieve such chart without data binding:

Code:
<jqChart:Chart ID="Chart1" Width="500px" Height="300px" runat="server">
        <Series>
            <jqChart:LineSeries Title="Series 1">
                <XValues>
                    <jqChart:DoubleValue Value="1" />
                    <jqChart:DoubleValue Value="2" />
                    <jqChart:DoubleValue Value="3" />
                    <jqChart:DoubleValue Value="4" />
                    <jqChart:DoubleValue Value="5" />
                    <jqChart:DoubleValue Value="6" />
                </XValues>
                <YValues>
                    <jqChart:DoubleValue Value="70" />
                    <jqChart:DoubleValue Value="40" />
                    <jqChart:DoubleValue Value="85" />
                    <jqChart:DoubleValue Value="50" />
                    <jqChart:DoubleValue Value="25" />
                    <jqChart:DoubleValue Value="40" />
                </YValues>
            </jqChart:LineSeries>
           <jqChart:LineSeries Title="Series 2">
                <XValues>
                    <jqChart:DoubleValue Value="2" />
                    <jqChart:DoubleValue Value="3" />
                    <jqChart:DoubleValue Value="4" />
                </XValues>
                <YValues>
                    <jqChart:DoubleValue Value="170" />
                    <jqChart:DoubleValue Value="140" />
                    <jqChart:DoubleValue Value="185" />
                </YValues>
            </jqChart:LineSeries>
        </Series>
    </jqChart:Chart>


Or you can populate the XValue and YValues of the series in the code behind:

Code:
LineSeries lineSeries = this.Chart1.Series[0] as LineSeries;
           
lineSeries.XValues.Add(new DoubleValue() { Value = 5 });
lineSeries.YValues.Add(new DoubleValue() { Value = 10 });
...


Probably, we should add functionality, so jqChart can be bound to more than one data source.
Best,
Ivan Petrov
jqChart Inc.
tlewi2
#5 Posted : Tuesday, December 3, 2013 4:52:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/2/2013(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Thanks, I used the code behind method sucessfully!
Users browsing this topic
Guest (3)
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.095 seconds.