Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Can't add more than one x/y series to scatterplot
Can't add more than one x/y series to scatterplot [message #369046] Wed, 22 July 2009 17:49 Go to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
The following code works fine when called once; but if called more than
once the chart blanks out. Any idea what I am doing wrong?

public void addData(String label, ColorDefinition color, ChartWithAxes
chart, NumberDataSet xv, NumberDataSet yv) {

Axis xa = chart.getPrimaryBaseAxes()[0];
Axis ya = chart.getPrimaryOrthogonalAxis(xa);

Series series = SeriesImpl.create();
series.setDataSet(xv);
SeriesDefinition xd = SeriesDefinitionImpl.create();
xa.getSeriesDefinitions().add(xd);
xd.getSeries().add(series);

ScatterSeries ss = (ScatterSeries) ScatterSeriesImpl.create();
ss.setSeriesIdentifier(label);
ss.setDataSet(yv);
SeriesDefinition yd = SeriesDefinitionImpl.create();
ya.getSeriesDefinitions().add(yd);
yd.getSeriesPalette().update(color);
yd.getSeries().add(ss);
}
Re: Can't add more than one x/y series to scatterplot [message #369049 is a reply to message #369046] Thu, 23 July 2009 01:11 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Just discovered that I can add multiple data sets -- provided they all
have the same size! What's causing this constraint?

Also, I was wondering if there was a way to get error messages out of
BIRT, rather than just blank charts whenever there is an issue?
Re: Can't add more than one x/y series to scatterplot [message #369050 is a reply to message #369049] Thu, 23 July 2009 01:33 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Eric Jain wrote:
> Also, I was wondering if there was a way to get error messages out of
> BIRT, rather than just blank charts whenever there is an issue?

My bad, was swallowing the exceptions:

org.eclipse.birt.chart.exception.ChartException: Mismatch (96!=192) in
dataset count found in stacked runtime series
at org.eclipse.birt.chart.factory.Generator.build(Generator.jav a:998)
...

So BIRT really can't draw more than one series in a scatterplot unless all
series have the same number of points?!
Re: Can't add more than one x/y series to scatterplot [message #369064 is a reply to message #369050] Thu, 23 July 2009 18:57 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Eric Jain wrote:
> So BIRT really can't draw more than one series in a scatterplot unless all
> series have the same number of points?!

Testing if padding the NumberDataSets with Double.NaN is a workaround...

Noticed that if more than one x/y series are added, all but the first are
misplaced along the x axis; what's the correct way to add more than one
x/y series?
Re: Can't add more than one x/y series to scatterplot [message #369131 is a reply to message #369064] Tue, 28 July 2009 18:57 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Eric Jain wrote:
> Testing if padding the NumberDataSets with Double.NaN is a workaround...

Seems to work!

> Noticed that if more than one x/y series are added, all but the first are
> misplaced along the x axis; what's the correct way to add more than one
> x/y series?

Looks like I'm the first to try to use more than one x/y series in a BIRT
scatter plot? :-(
Re: Can't add more than one x/y series to scatterplot [message #369147 is a reply to message #369131] Tue, 28 July 2009 21:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Eric,

Can you log a bug for this? Also all series do have to have the same
number of points, but you should be able to pad datasets in the after
dataset filled script to meet this goal.

Jason

Eric Jain wrote:
> Eric Jain wrote:
>> Testing if padding the NumberDataSets with Double.NaN is a workaround...
>
> Seems to work!
>
>> Noticed that if more than one x/y series are added, all but the first
>> are misplaced along the x axis; what's the correct way to add more
>> than one x/y series?
>
> Looks like I'm the first to try to use more than one x/y series in a
> BIRT scatter plot? :-(
>
>
Re: Can't add more than one x/y series to scatterplot [message #468261 is a reply to message #369147] Tue, 04 August 2009 18:20 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Jason Weathersby wrote:
> Can you log a bug for this? Also all series do have to have the same
> number of points, but you should be able to pad datasets in the after
> dataset filled script to meet this goal.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=285620
Re: Can't add more than one x/y series to scatterplot [message #479673 is a reply to message #468261] Tue, 11 August 2009 22:16 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
For the record:

Figured out that the proper way to have multiple x/y series in a scatter
chart (and other types of charts) is to create a single x/y series and
call setSorting + setQuery on the y SeriesDefinition to separate the data
points into distinct groups. This approach is cleaner, and avoids the
multiple-x/y-series flakiness.
Re: Can't add more than one x/y series to scatterplot [message #829654 is a reply to message #479673] Mon, 26 March 2012 15:50 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009
Member
Hi Eric,

I know this was some time ago but I just found this on a search of the
newsgroup as this is exactly what I am attempting. Do you a have an
example of the solution you are able to share?

Thanks for your help,

Nigel

On 11/08/2009 23:16, Eric Jain wrote:
> For the record:
>
> Figured out that the proper way to have multiple x/y series in a scatter
> chart (and other types of charts) is to create a single x/y series and
> call setSorting + setQuery on the y SeriesDefinition to separate the
> data points into distinct groups. This approach is cleaner, and avoids
> the multiple-x/y-series flakiness.
>
>
Re: Can't add more than one x/y series to scatterplot [message #830768 is a reply to message #829654] Wed, 28 March 2012 03:14 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Nigel,

I do not think he did it with more than one data set. I think he just
grouped his data.

Jason

On 3/26/2012 11:51 AM, Nigel Daniels wrote:
> Hi Eric,
>
> I know this was some time ago but I just found this on a search of the
> newsgroup as this is exactly what I am attempting. Do you a have an
> example of the solution you are able to share?
>
> Thanks for your help,
>
> Nigel
>
> On 11/08/2009 23:16, Eric Jain wrote:
>> For the record:
>>
>> Figured out that the proper way to have multiple x/y series in a scatter
>> chart (and other types of charts) is to create a single x/y series and
>> call setSorting + setQuery on the y SeriesDefinition to separate the
>> data points into distinct groups. This approach is cleaner, and avoids
>> the multiple-x/y-series flakiness.
>>
>>
>
Re: Can't add more than one x/y series to scatterplot [message #832560 is a reply to message #830768] Fri, 30 March 2012 09:27 Go to previous message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009
Member
Hi Jason,

Thanks for getting back to me. Is what I am asking possible using Birt?
I'm trying to replicate something I have done in Excel so far.

Best regards,

Nigel

On 28/03/2012 04:14, Jason Weathersby wrote:
> Nigel,
>
> I do not think he did it with more than one data set. I think he just
> grouped his data.
>
> Jason
>
> On 3/26/2012 11:51 AM, Nigel Daniels wrote:
>> Hi Eric,
>>
>> I know this was some time ago but I just found this on a search of the
>> newsgroup as this is exactly what I am attempting. Do you a have an
>> example of the solution you are able to share?
>>
>> Thanks for your help,
>>
>> Nigel
>>
>> On 11/08/2009 23:16, Eric Jain wrote:
>>> For the record:
>>>
>>> Figured out that the proper way to have multiple x/y series in a scatter
>>> chart (and other types of charts) is to create a single x/y series and
>>> call setSorting + setQuery on the y SeriesDefinition to separate the
>>> data points into distinct groups. This approach is cleaner, and avoids
>>> the multiple-x/y-series flakiness.
>>>
>>>
>>
>
Previous Topic:Using bindings in the expression editor?
Next Topic:How to get all default values of scalar parameter
Goto Forum:
  


Current Time: Sat Apr 20 03:18:13 GMT 2024

Powered by FUDForum. Page generated in 0.03612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top