MASON-INTEREST-L Archives

May 2012

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Fri, 4 May 2012 15:02:35 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
You're correct, each series attributes corresponds to exactly one series.

reviseColor() is a utility method for guaranteeing that a color is valid. It probably shouldn't be public.

I think what you want is TimeSeriesAttributes.setStrokeColor(...), something like:

(TimesSeriesAttributes) tsa = (TimeSeriesAttributes)(attrib[0]);
tsa.setStrokeColor(Color.blue);

Sean


On May 4, 2012, at 2:52 PM, Joaquin Zabalo wrote:

> Thanks. I wasn't aware that the method no longer existed. I revised my code
> as indicated in the following segments:
>
> TimeSeriesChartGenerator chartgen;
> SeriesAttributes[] attrib = new TimeSeriesAttributes[2];
> XYSeries[] series = new XYSeries[2];
>
> series[0] = new XYSeries("Fish", false);
> series[1] = new XYSeries("Seal", false);
>
> chartgen.addSeries(series[0], null);
> chartgen.addSeries(series[1], null);
>
> attrib = chartgen.getSeriesAttributes();
>
> However, I'm still not sure how to modify a particular series' attributes in
> order to change the line color in the plot. Does each entry in the
> SeriesAttributes array correspond to exactly one time series? If this is so,
> then I assume that to change the color corresponding to series[0], the code
> would read:
>
> attrib[0].reviseColor(Color.blue, 1.0);
>
> But this did not work. Maybe SetStrokeColor(Color.blue) should somehow be
> used instead. I don't know.
>
> Any suggestions?
>
> Thanks again.

ATOM RSS1 RSS2