[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.birt] Re: Charts: Is there a way to programmatically display legend names?
|
- From: ameena@xxxxxxxxx (Ameena )
- Date: Fri, 31 Oct 2008 02:09:47 +0000 (UTC)
- Newsgroups: eclipse.birt
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Hi Jason,
Thanks for the excellent example. I understand it for the most part.
However I don't get this part in the fxn beforeDrawLegend:
var myst3 =
icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("seriestitle1");
How/where exactly in your example is seriestitle1 set??
I see that you have created the "seriestitle" data set, which has series1,
series2, and series3 attributes (with the same names that correspond to
your scripted data set called 'Data Set'). But no where else do I see
anything mapping to seriestitle1.
What I have tried doing is the following:
1. Created a data set called 'gif-data' which gives the following result
from a MySql query;
time first
------------
05/08 100
06/08 200
2. Create a data set called "title1" which gives the following result from
a MySql query:
first
-----
gif
3. I copy the "title1" data set to the Layout page and set it to invisible
4. I create a Line Chart based on the 'gif-data' set, with the category
(x) series set to row["time"] and value (y) series set to row["first"]. I
now have a line graph.
5. In the Format Chart section, I have the value (y) series 1 called
"first-title".
6. Now I am ready to add the beforeDrawLegend to the Script portion for
the Line chart:
if(
lerh.getLabel().getCaption().getValue().compareToIgnoreCase("first-title")
== 0 ){
var myst3 =
icsc.getExternalContext().getScriptable().getPersistentGlobalVariable(???????);
lerh.getLabel().getCaption().setValue(myst3);
}
}
What do I fill in for the ?????? part? Everything I've been trying gives
me a "null" in the legend field.
Thanks again,
Ameena