Sender: |
|
Date: |
Thu, 27 Aug 2009 14:18:26 -0400 |
Reply-To: |
|
Content-Transfer-Encoding: |
8BIT |
Subject: |
|
From: |
|
Content-Type: |
TEXT/PLAIN; charset=ISO-8859-1 |
In-Reply-To: |
|
MIME-Version: |
1.0 |
Comments: |
|
Parts/Attachments: |
|
|
Hi,
You should call setStrokeColor() on TimeSeriesAttributes object
rather than getting the renderer.
As for the ColorWell (on the left hand side bar) not changing colors,
that's on us. I'll commit the fix, but if you downloaded MASN rather
than using CVS, then you'll have to do the change yourself:
The body of TimeSeriesAttributes.setStrokeColor(Color value) should read
{strokeColorWell.setColor(strokeColor = value);}
instead of { strokeColorWell.changeColor(strokeColor = value); }
Thank you for pointing the bug to us,
Gabriel Balan
On Thu, 27 Aug 2009, MASON-INTEREST-L automatic digest system wrote:
> There is 1 message totalling 40 lines in this issue.
>
> Topics of the day:
>
> 1. Changing plot color in TimeSeriesChartGenerator
>
> ----------------------------------------------------------------------
>
> Date: Wed, 26 Aug 2009 16:00:16 -0400
> From: Joerg Hoehne <[log in to unmask]>
> Subject: Changing plot color in TimeSeriesChartGenerator
>
> I'd like to set the color of the plotted line which works fine with the code below.
>
> TimeSeriesChartGenerator chart;
> XYSeries series[];
>
> .....
> series[i] = new XYSeries("food source" + (i + 1), false);
> chart.addSeries(series[i], null);
>
> // get the series for the current index
> TimeSeriesAttributes tsa = (TimeSeriesAttributes) chart.getSeriesAttributes(i);
>
> // every series has its own plotter
> XYPlot plot = tsa.getPlot();
> // the first renderer is the one for the line so it is fine
> XYItemRenderer r = plot.getRenderer(0);
> r.setSeriesPaint(i, foodSources[i].getColor());
>
> tsa.buildAttributes();
>
> But the LabelledList (below the "Save as PDF"-button) on the left of the TimeSeriesChartGenerator
> does not reflect the current color choice so I've added the tas.buildAttributes() line in the code.
> Now I see the current color but I the fields are doubled (the fields Series, Color, Width, Dash and
> Stretch). I have first to remove the old items from the list but I find no method for this one.
>
> My question: Is there any way to create the series and add it with a given color set?
>
>
> Regards,
> Jörg
>
> ------------------------------
>
> End of MASON-INTEREST-L Digest - 24 Aug 2009 to 26 Aug 2009 (#2009-25)
> **********************************************************************
>
|
|
|