How to display zero value [message #870854] |
Wed, 09 May 2012 19:53  |
Eclipse User |
|
|
|
How to display zero value in the bar chart value series.
Attached the sample file and report design.
Thanks in advance
AR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to display zero value [message #1711296 is a reply to message #1693993] |
Wed, 14 October 2015 12:15  |
Eclipse User |
|
|
|
Hello,
The script above worked for me at that time, and months later when i open up my report design file, this part of the script has mysteriously vanished. So has some visibility settings, sorting etc
Instead I find the below for 'onRender' for the chart:
----------------------------------------------------------------------------
function afterDataSetFilled( series, dataSet, icsc )
{
if(series.getSeriesIdentifier() != ""){
if(dataSet.getValues()[0] == 0){
dataSet.getValues()[0] = 1;
icsc.getExternalContext().getScriptable().setPersistentGlobalVariable(series.getSeriesIdentifier(),"not null");
}
}
}
function beforeDrawDataPointLabel( dph, label, icsc )
{
if(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable(dph.getSeriesDisplayValue()) != null){
label.getCaption().setValue("0");
}
}
/**
* Called before populating the series dataset using the DataSetProcessor.
*
* @param series
* Series
* @param idsp
* IDataSetProcessor
* @param icsc
* IChartScriptContext
*/
function beforeDataSetFilled( series, idsp, icsc )
{
}
----------------------------------------------------------------------------
But this script does not display a small bar for 0 values.
I tried adding:
----------------------
function afterDataSetFilled(series, dataSet, icsc)
{
var list = dataSet.getValues();
for ( i=0; i<list.length; i=i+1)
{
if ( list[i] == 0 )
{
list[i]= 1;
}
}
}
----------------------
Not working. Why do you think this happened? I am positive I have not made these changes. How do I go back to fixing the 0 value on the chart.
Thanks a lot for your help.
|
|
|
Powered by
FUDForum. Page generated in 0.16039 seconds