Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how to get a x axis label value by parameter in bar chart
404040
Hi,BIRT i have one doubt ,am having dataset with many FIELD like alphabet,animals,...etc<br />
how to pass parameter vaule to alphabet = A,B,C by checkbox and then it have to grab x axis label value from bar chart it have to produce a result <br />
<br />
<strong class='bbc'>for example </strong><br />
<br />
ALL<br />
A
>APPLE IN X-axis label<br />
B
>BALL IN X-axis label<br />
C
>CAT IN X-axis label <br />
<br />
when i click a ALL option it will display A,B,C in bar chart <br />
when i click a A option it will display only APPLE in bar chart <br />
when i click a B option it will display only BALL in bar chart <br />
when i click a C option it will display only CAT in bar chart <br />
thanks in advance ........<br />
can u produce a sampledb for this....
Find more posts tagged with
Comments
kclark
To get the value of a parameter from a chart you'd need to use<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var newLabel = icsc.getExternalContext().getScriptable().getParameterValue("ParameterName")
</pre>
<br />
To set the label it'd look something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>function beforeDrawAxisLabel( axis, label, icsc )
{
var newLabel = icsc.getExternalContext().getScriptable().getParameterValue("NewParameter");
label.getCaption().setValue(newLabel)
}
</pre>
404040
thank for ur reply ......
i have another doubt that is am having 4 listbox in this A is --> list box
B,C,D--->cascading parameter while IF A list box has been selected it only be run the report
at that time B,C,D must be disable ,again if i select B,C,D
A will be disable...by onclick or by some script ...
can u able produce a sampledb for this....
thanks in advance
kclark
Do the parameters need to become disabled or can they become invisible? If they can be invisible then you could make a custom parameter page doing something like this.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
function enableDisable() {
var theParams = document.getElementById('myParams');
if(theParams.style.visibility == 'hidden') {
theParams.style.visibility = 'visible';
}else{
theParams.style.visibility = 'hidden';
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<input type="checkbox" name="vehicle" value="disable" onClick="enableDisable();">Disable<br>
<birt:parameterPage
id="report1"
name="page1"
reportDesign="enabledisable.rptdesign"
isCustom="true"
pattern="frameset">
<div id="myParams" name="myParams">
Customer:<br>
<birt:paramDef id="10" name="customer" />
<br><br>
Order:<br>
<birt:paramDef id="11" name="order" />
<br><br>
</div>
<input type="Submit" value="Run Report">
</birt:parameterPage>
</body>
</html>
</pre>
404040
First of all thanks for u r reply ...its wonderful ...post<br />
<br />
my question is parameters need to become disabled but option will be visible <br />
<br />
for example:<br />
<br />
<strong class='bbc'>A</strong> listbox contain the value john,vinoth,senthil,kumar while am clicking a john by onclick the value will be display a chart..<br />
<br />
that time <strong class='bbc'>B,C,D</strong> --> cascading parameter option will be visible but value will be disable ...<br />
<br />
again from B,C,D i will select a value from this option chart will be display.. at that time a A option wil be visible but it wil be disable....<br />
<br />
<br />
i think u wil be understood ..<br />
<br />
thanks in advance
404040
HI,birt...am looking for ur answer...for above post
if u give me solution its very useful me
and i have a another doubt in this script we are getting baseAxes value according to parameter
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
if ( xAxis.getType() == AxisType.DATE_TIME_LITERAL){
var groupparm = icsc.getExternalContext().getScriptable().getParameterValue("pDateGrouping");
if( groupparm == "Days")
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/dd/yyyy") );
}
else if( groupparm == "Years" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("yyyy") );
}
else if( groupparm == "Months" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/yy") );
}
else if( groupparm == "Quarters" ){
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("'Q'Q/yy") );
}
}
}
like wise i have one table in that many columns are there zone,state,city,...its go on
so now my doubt is
for example:
if i click option "zone" in list box i have get value in bar chart south,west,east,north in x-axis and corresponding net sale in y axis....
if i click option "state" in list box i have get value in bar chart tamilnadu,kerala,chennai, in x-axis and corresponding net sale in y axis....
thanks in advance..............
404040
am waiting for ur solution.......
kindly reply me...for above two post
thank u in advance....
kclark
Sorry for the delayed response. I've attached an example for the parameter page for you. If I understand correctly if parameter a is selected then the rest of the parameters need to be disabled and if b through z are selected then a needs to be disabled.
I had to use the tag library to bring in the parameters and make them invisible. Then I created html controls for the drop down lists. OnLoad() I grabbed the values of the hidden parameters and placed them in the new HTML controls.
On change of the second parameter which is the parent of a cascading parameter group I forced the hidden parameter to change then changed the values of the third parameter to match.
Let me know if this is what you were needing.
404040
thank u very much ....kclark
i wil try and say of my result......
on the process of i have another doubt in my report
in this script we are getting baseAxes value according to parameter
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
if ( xAxis.getType() == AxisType.DATE_TIME_LITERAL){
var groupparm = icsc.getExternalContext().getScriptable().getParameterValue("pDateGrouping");
if( groupparm == "Days")
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/dd/yyyy") );
}
else if( groupparm == "Years" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("yyyy") );
}
else if( groupparm == "Months" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/yy") );
}
else if( groupparm == "Quarters" ){
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("'Q'Q/yy") );
}
}
}
like wise i have one table in that many columns are there zone,state,city,...its go on
so now my doubt is
for example:
if i click option "zone" in list box i have get value in bar chart south,west,east,north in x-axis and corresponding net sale in y axis....
if i click option "state" in list box i have get value in bar chart tamilnadu,kerala,chennai, in x-axis and corresponding net sale in y axis....
thanks in advance..............
404040
first of all thank for ur trying ..... <br />
<br />
am waiting reply above post<br />
<br />
and then while i ran this report with cascade report i have getting error like this <br />
<br />
<br />
org.eclipse.birt.report.exception.ViewerValidationException: The parameter "order" cannot be blank.<br />
at org.eclipse.birt.report.utility.DataUtil.validate(DataUtil.java:176)<br />
at org.eclipse.birt.report.utility.BirtUtility.handleOperation(BirtUtility.java:574)<br />
at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:128)<br />
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)<br />
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)<br />
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)<br />
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:601)<br />
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)<br />
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:601)<br />
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)<br />
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)<br />
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)<br />
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)<br />
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)<br />
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)<br />
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)<br />
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)<br />
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)<br />
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)<br />
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<br />
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)<br />
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)<br />
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br />
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)<br />
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br />
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br />
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br />
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br />
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br />
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br />
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br />
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)<br />
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)<br />
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)<br />
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)<br />
at java.lang.Thread.run(Thread.java:722)<br />
<br />
<br />
u understood correctly but <strong class='bbc'>a</strong> will be separate listbox is selected then the rest of the parameters need to be disabled and if<strong class='bbc'> b through z</strong> are separate cascade parameter selected then <strong class='bbc'>a</strong> needs to be disabled.like wise its go...<br />
<br />
but wt happen in sampleparam.jsp is first i select city then customer and order will be disable.full list box..but at that time i cant able to select customer and order for second selection it will be disable only...<br />
<br />
my requirement is both will be visible <br />
i) <strong class='bbc'>a</strong> is separate list box with some value <br />
ii)<strong class='bbc'>b to z</strong> will be separate cascade parameter <br />
<br />
if i select <strong class='bbc'>a listbox</strong> if i selected a value it will be display in page..like wise it will go for other option...<br />
<br />
then user select into b to z cascade parameter if i select value it will be display in page at that time <strong class='bbc'>a </strong>listbox wil not be overwrite<br />
<br />
then user again go to <strong class='bbc'>a</strong> listbox he wil select some value to see record like wise it will go.... <br />
<br />
<br />
thank in advance
404040
sir am waiting for solution....above post
in this script we are getting baseAxes value according to parameter
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
if ( xAxis.getType() == AxisType.DATE_TIME_LITERAL){
var groupparm = icsc.getExternalContext().getScriptable().getParameterValue("pDateGrouping");
if( groupparm == "Days")
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/dd/yyyy") );
}
else if( groupparm == "Years" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("yyyy") );
}
else if( groupparm == "Months" )
{
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("MM/yy") );
}
else if( groupparm == "Quarters" ){
xAxis.setFormatSpecifier( JavaDateFormatSpecifierImpl.create("'Q'Q/yy") );
}
}
}
my requirement
function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
xAxis = chart.getBaseAxes()[0];
if ( xAxis.getType() == AxisType.TEXT_LITERAL){
var groupparm = icsc.getExternalContext().getScriptable().getParameterValue("geography");
if( groupparm == "zone")
{
xAxis.?( ?.create("?") );
}
else if( groupparm == "state" )
{
xAxis.?( ?.create("?") );
}
else if( groupparm == "city" )
{
xAxis.?( ?.create("?") );
}
}
like wise i have one table in that many columns are there zone,state,city,...its go on
so now my doubt is
for example:
if i click option "zone" in list box i have get value in bar chart south,west,east,north in x-axis and corresponding net sale in y axis....
if i click option "state" in list box i have get value in bar chart tamilnadu,kerala,chennai, in x-axis and corresponding net sale in y axis....
thanks in advance..............
404040
is there anybody to reply for above post...
thank in advance