charting questions [message #15348] |
Mon, 07 March 2005 17:41  |
Eclipse User |
|
|
|
Originally posted by: nicholas.gauthier.utah.edu
Hello All,
Well I checked out birt for the first time today. Good job!
Anyway I have a couple of questions about the charting. I am
specifically interested in using only the charting engine in a
standalone SWT application. I ran the example given in the thread
"create a line chart programmatically" and have a couple of questions.
1. Is it possible to implement call backs when the user clicks or hovers
over nodes in the chart (I want to display details about the node)?
2. Is it possible to put the x-axis on the bottom of the chart instead
of the middle?
3. It seems impossible to remove the title and legend from the generated
chart. Just calling their respective setVisible(false) methods doesn't
seem to do anything. Is the visibility configurable some other way? In
the source from CVS I found that the the ChartWithAxesImpl.create()
appears to initialize all these items...maybe there is some other way to
"create" the chart?
Based on the amount of number of questions about SWT charting in the
eclipse newsgroups, I think this project will generate a lot of
interest. Thanks for your help and keep up the good work!
Nick.
|
|
|
Re: charting questions [message #15699 is a reply to message #15348] |
Tue, 08 March 2005 00:13   |
Eclipse User |
|
|
|
Hi Nicholas,
Here's answers to your questions:
1. Yes ... you may add 'triggers' for various 'conditions' in the
design-time chart model associated with 'series' or 'blocks' as follows:
PieSeries sePie = ...;
sePie.getTriggers().add(
TriggerImpl.create(
TriggerCondition.MOUSE_CLICK_LITERAL,
ActionImpl.create(
ActionType.URL_REDIRECT_LITERAL,
URLValueImpl.create(
"http://www.actuate.com", null, "city", "population", null
)
)
)
);
This trigger causes a URL redirect notification when a user clicks on a
slice in a pie chart. However, this has only been implemented for the
swing device renderer.
A reference implementation of handling user interaction has been provided
in org.eclipse.birt.chart.device.swing.SwingRendererImpl in the following
parts of the class:
variables: _iun, _eh, _lhmAllTriggers
method: enableInteraction
This method creates a low-level 'ShapedAction' for a polygon, an arc or an
oval and places it into the linked hashmap of all triggers.
Later, when rendered, the SwingEventHandler class listens for AWT events
on these shaped objects and notifies the class defined that implements
IUpdateNotifier to update itself due to user interaction at view time. The
update notifier (depending on the context) should be capable of:
A] Regenerating the chart (for the design-time model)
B] Repainting the chart (for the existing generated instance)
This hasn't yet been implemented for SWT but should be easily doable.
2. Yes you may place the X-axis at the bottom ... using the following API:
xAxis.getOrigin().setType(IntersectionType.MIN_LITERAL);
... where MIN indicates 'the minimum vertical position of the plot
(bottom)' when applied to the X axis or 'the minimal horizontal position
of the plot (left)' when applied to the Y axis'.
3. Yes ... setting 'block' visibility for the 'TitleBlock' and the
'Legend' is supposed to make that happen but hasn't yet been implemented.
I should have it done in a day or two so check back soon.
Rohit Colaco
ECE Project Lead
---
Nicholas Gauthier wrote:
> Hello All,
> Well I checked out birt for the first time today. Good job!
> Anyway I have a couple of questions about the charting. I am
> specifically interested in using only the charting engine in a
> standalone SWT application. I ran the example given in the thread
> "create a line chart programmatically" and have a couple of questions.
> 1. Is it possible to implement call backs when the user clicks or hovers
> over nodes in the chart (I want to display details about the node)?
> 2. Is it possible to put the x-axis on the bottom of the chart instead
> of the middle?
> 3. It seems impossible to remove the title and legend from the generated
> chart. Just calling their respective setVisible(false) methods doesn't
> seem to do anything. Is the visibility configurable some other way? In
> the source from CVS I found that the the ChartWithAxesImpl.create()
> appears to initialize all these items...maybe there is some other way to
> "create" the chart?
> Based on the amount of number of questions about SWT charting in the
> eclipse newsgroups, I think this project will generate a lot of
> interest. Thanks for your help and keep up the good work!
> Nick.
|
|
|
Re: charting questions [message #15721 is a reply to message #15348] |
Tue, 08 March 2005 00:13  |
Eclipse User |
|
|
|
Hi Nicholas,
Here's answers to your questions:
1. Yes ... you may add 'triggers' for various 'conditions' in the
design-time chart model associated with 'series' or 'blocks' as follows:
PieSeries sePie = ...;
sePie.getTriggers().add(
TriggerImpl.create(
TriggerCondition.MOUSE_CLICK_LITERAL,
ActionImpl.create(
ActionType.URL_REDIRECT_LITERAL,
URLValueImpl.create(
"http://www.actuate.com", null, "city", "population", null
)
)
)
);
This trigger causes a URL redirect notification when a user clicks on a
slice in a pie chart. However, this has only been implemented for the
swing device renderer.
A reference implementation of handling user interaction has been provided
in org.eclipse.birt.chart.device.swing.SwingRendererImpl in the following
parts of the class:
variables: _iun, _eh, _lhmAllTriggers
method: enableInteraction
This method creates a low-level 'ShapedAction' for a polygon, an arc or an
oval and places it into the linked hashmap of all triggers.
Later, when rendered, the SwingEventHandler class listens for AWT events
on these shaped objects and notifies the class defined that implements
IUpdateNotifier to update itself due to user interaction at view time. The
update notifier (depending on the context) should be capable of:
A] Regenerating the chart (for the design-time model)
B] Repainting the chart (for the existing generated instance)
This hasn't yet been implemented for SWT but should be easily doable.
2. Yes you may place the X-axis at the bottom ... using the following API:
xAxis.getOrigin().setType(IntersectionType.MIN_LITERAL);
... where MIN indicates 'the minimum vertical position of the plot
(bottom)' when applied to the X axis or 'the minimal horizontal position
of the plot (left)' when applied to the Y axis'.
3. Yes ... setting 'block' visibility for the 'TitleBlock' and the
'Legend' is supposed to make that happen but hasn't yet been implemented.
I should have it done in a day or two so check back soon.
Rohit Colaco
ECE Project Lead
---
Nicholas Gauthier wrote:
> Hello All,
> Well I checked out birt for the first time today. Good job!
> Anyway I have a couple of questions about the charting. I am
> specifically interested in using only the charting engine in a
> standalone SWT application. I ran the example given in the thread
> "create a line chart programmatically" and have a couple of questions.
> 1. Is it possible to implement call backs when the user clicks or hovers
> over nodes in the chart (I want to display details about the node)?
> 2. Is it possible to put the x-axis on the bottom of the chart instead
> of the middle?
> 3. It seems impossible to remove the title and legend from the generated
> chart. Just calling their respective setVisible(false) methods doesn't
> seem to do anything. Is the visibility configurable some other way? In
> the source from CVS I found that the the ChartWithAxesImpl.create()
> appears to initialize all these items...maybe there is some other way to
> "create" the chart?
> Based on the amount of number of questions about SWT charting in the
> eclipse newsgroups, I think this project will generate a lot of
> interest. Thanks for your help and keep up the good work!
> Nick.
|
|
|
Powered by
FUDForum. Page generated in 0.04791 seconds