|
There's no way this can be done for 1.8 final. Moving it to 1.9M1.
Guys, I've added support for the following chart types (besides the existing pie type):
-bar -line -area Unless you notice some other issues to do, I now only have to refurbish a little the source code and to add test cases. Bellow you have an example of usage for the chart macro, after making these modifications and the output is the one from the attached screenshot. (chart.png) |AAA | BBB ($)
|Category 1 | 200
|Category 2 | 500
|Category 3 | 300
{{chart chartType="pie" source="type:XDOM; table_number:0;range:A1-B3;" height="30" /}}
{{chart chartType="bar" source="type:XDOM; table_number:0;range:A1-B3;" height="60"/}}
|Aaa | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | 9.0
|First | 1.0 | 4.0 | 3.0 | 5.0 | 5.0 | 7.0 | 8.0
|Second | 5.0 | 7.0 | 6.0 | 8.0 | 4.0 | 4.0 | 2.0
|Third | 3.0 | 4.0 | 4.0 | 3.0 | 2.0 | 3.0 | 6.0
{{chart chartType="line" source="type:XDOM; table_number:1;range:A1-C3;series:rows" title="line (xy_line_and_shape, default)" /}}
{{chart chartType="area" source="type:XDOM; table_number:1;series:rows" /}}
Nice.
Some questions:
{{chart ...}}
| 1.0 | 2.0
| 3.0 | 4.0
{{/chart}}
I haven't looked at implementation yet. Hi,
Well, let me answer those questions one by one: -the "renderer:circle" option currently doesn't have any effect on the macro, i used it for testing purposes and removed it after that. -currently, we have only XDOM sources, which take the data from a table nested within a XDOM tree -"chartType" has been renamed to "type" -i could create a special source type (i could name it "inlineDataSource) to make the chart take the data from a table nested within the macro's body as in the example -right now it cannot reference other documents, for this to happen i see the following approach:
I look forward for getting your feedback. This patch covers everything except for the tests, where I'm stuck with a problem: if try to write a simple test, it fails with the following error: java.lang.AbstractMethodError: gnu.xml.dom.DomDocument.adoptNode(Lorg/w3c/dom/Node;)Lorg/w3c/dom/Node; (more details in
So, I'm thinking, after I return from vacation, to write ordinary JUnit test cases and manually call CharMacro.execute() and test the output instead of writing rendering tests. So far this is the only solution that comes to my mind to overcome that error. Excepting that issue, the macro should perform ok. I've added support for grabbing data from other documents, too, as well as from the macro body. An example of using these new features: Inline:
{{chart type="pie" source="type:inline;range:A1-B4; height:166; width: 77"}}
|AAA | BBB ($)
|Category 1 | 20
|Category 2 | 500
|Category 3 | 300
{{/chart}}
From another document :
{{chart type="pie" source="type:xdom; document:Main.Table; table_number:0;range:A1-B4 " height="100" width="77" /}}
Best regards, This one includes tests, as well. As I said before, I wrote ordinary JUnit test cases and manually called CharMacro.execute() to test the result instead of writing rendering tests. So this is it, please let me know what you think about it.
I look forward to getting to know what else needs to be done in order for this macro to be commited. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bellow you have an example that illustrates the macro's usage with what's been done so far:
|Category | Sales ($) |Category 1 | 1000000 |Category 2 | 1500000 |Category 3 | 500000 {{chart chartType="pie" sourceType="xdom" table_number="1" range="A1-B4" /}}Unit tests and checkstyle validations are going to be added in the future.