1.
When you add another series with the same name, it's not replacing the existing series (i.e. it's still an add operation). You can check the code in report module.
When you render the model as table, xml, csv, all series will show up. But if you render the model as chart, only one serie from all those series with the name will show up.
HackyReport does pass all series to JFreeChart, but JFreeChart only keeps one series per unique name. (I guess, inside JFreeChart, it uses Map.put() when you add series data).
2.
streams A = { template<pattern> ActiveTime(pattern) };
charts C = { (A<"**">, A<"**/*.java"> };Then chart C has two series, which are both called "A" (in my current implementation). I need to find a new naming convention no matter we decide we raise a RuntimeException or not.
Cheers,
Cedric
Aaron Kagawa wrote:
This is an interesting problem..
What does the javadoc say is going to happen? Lets change it to accurate reflect what is going to happen.
My idea is that hackyReport can throw a RuntimeException if there is name duplication (which does not violate its design feature).
But, what if the client actually wants to replace the series? Much like the put method in a Map replaces the object associated with the key. Throwing a RuntimeException would make the method less robust.
This is the second time that I have spent time debugging this issue. I am sure there will be the third time (either me or somebody else) if we don't do anything about it.
Just curious, why would you be trying to chart out series with different values but have the same name anyway? In the extreme case of 10 series all with the same name and all with different values would seem very hard to understand.
just my 2 cents, aaron
At 11:31 PM 10/10/2004 -1000, you wrote:
My idea is that hackyReport can throw a RuntimeException if there is name duplication (which does not violate its design feature).
Fail-fast is always better than fail-late (and leave every one wondering what goes wrong).
This is the second time that I have spent time debugging this issue. I am sure there will be the third time (either me or somebody else) if we don't do anything about it.
Anyway, I have to change my program logic. Cheers, Cedric
Philip Johnson wrote:
My initial thought is that requiring each series to be uniquely identified by name is not an unreasonable design feature for hackyReport.
Cheers,
Philip
--On Sunday, October 10, 2004 2:16 PM -1000 "(Cedric) Qin ZHANG" <[EMAIL PROTECTED]> wrote:
Hi,
In report package, chart model consists of one or more "series", and each
series has a name.
I found that if two series has the same name, then only one of them will
show up in the rendered chart.
While I can change my program logic to guarantee uniqueness of series name, but I am not sure whether the problem is generic enough so that it's better to be handled in report model or not.
Any opinion?
Thanks.
Cedric
