Hide series label when series value equals zero? [message #143942] |
Wed, 15 March 2006 06:57  |
Eclipse User |
|
|
|
Hello,
I would like to know if it is possible to hide the series label in a bar
series if the series value equals zero?
I have several bar series stacked on top of eachother and if any of the
values in a series is 0,
the bar is placed at the bottom of the stacked bars (even if its position
would have been in the middle or at the top
if it would have had values) and a "0" label is shown.
I do not want to see a label if there is no value, is that possible to
achieve?
- Elin Karasalo
|
|
|
Re: Hide series label when series value equals zero? [message #144132 is a reply to message #143942] |
Wed, 15 March 2006 13:17  |
Eclipse User |
|
|
|
Originally posted by: vladperl.semanticprogrammer.org
> if it would have had values) and a "0" label is shown.
> I do not want to see a label if there is no value, is that possible to
> achieve?
You can use java script for that.
Click in layout mode on chart item and then switch to script tab.
There are plenty commented chart script methods.
The chart script methods provide control on the chart databinding,
generation and rendering.
I have just tried one of them today.
my example:
function beforeDrawAxisLabel(axis, label, context) {
var months = new Array(13);
months[1] = "Jan";
months[2] = "Feb";
months[3] = "Mar";
months[4] = "Apr";
months[5] = "May";
months[6] = "Jun";
months[7] = "Jul";
months[8] = "Aug";
months[9] = "Sep";
months[10] = "Oct";
months[11] = "Nov";
months[12] = "Dec";
label.getCaption().setValue(months[parseInt(label.getCaption ().getValue())]);
}
Keep in mind that global variables for some reason not available in this
methods.
Also you should know that doesn't exists any documentation regarding using
scripting with chart.
At least in help I see nothing.
Don't try to search visual connections from chart item to chart scripts
methods.
You will find nothing :)
You could check out also link:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=109627
Let me know if that is what you need.
Good luck,
Vladimir
|
|
|
Powered by
FUDForum. Page generated in 0.03466 seconds