Can't add more than one x/y series to scatterplot [message #369046] |
Wed, 22 July 2009 13:49  |
Eclipse User |
|
|
|
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 #832560 is a reply to message #830768] |
Fri, 30 March 2012 05:27  |
Eclipse User |
|
|
|
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.
>>>
>>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06341 seconds