Multiple graphs per report [message #884642] |
Mon, 11 June 2012 10:43  |
Eclipse User |
|
|
|
I am trying to figure out how to have multiple charts per report. Let me start with a simple example. Say I have a table in a database called Book, a table called BookType and another table called Price. Books can have and will have multiple Book types and multiple prices. For each Book and Book Type I want the price of the book over time, since prices constantly change. So the x axis would be the date timestamp, the y axis would be the price of the book and the y series grouping would be a group by book name and book type. At the moment I have all the books and book types on the same graph. The end user has suggested I break the graph up by (book name, book type). This would mean I have to have a graph for each book name, book type group. The only idea I had was to put the graph in a table. If I do this I don't see how I could set the query for the graph to only show the book name and book type for that row. Are there any ways of doing this? Maybe a different way that I cannot think of?
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Multiple graphs per report [message #886203 is a reply to message #885909] |
Thu, 14 June 2012 08:37  |
Eclipse User |
|
|
|
Thank you. I was able to do it by adding 2 more global variables. One is a counter and the other is the other value. I put an if statement to determine which line to set. importPackage(Packages.org.eclipse.birt.chart.model.data.impl);
function beforeDrawMarkerLine( axis, markerLine, context)
{
target = context.getExternalContext().getScriptable().getPersistentGlobalVariable("COUNTER");
if(target != 0)
{
target = context.getExternalContext().getScriptable().getPersistentGlobalVariable("MAX_THRESHOLD");
markerLine.setValue(NumberDataElementImpl.create(target));
markerLine.getLabel().getCaption().setValue("Max Threshsold " + target);
context.getExternalContext().getScriptable().setPersistentGlobalVariable("COUNTER", "0");
}
else
{
target = context.getExternalContext().getScriptable().getPersistentGlobalVariable("MIN_THRESHOLD");
markerLine.setValue(NumberDataElementImpl.create(target));
markerLine.getLabel().getCaption().setValue("Min Threshsold " + target);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.10864 seconds