Skip to Content
avatar image
Former Member

creating chart using element

Hi,

I have followed below steps to create pie chart using elements but it is showing greyed out Bar chart instead of Pie

1) created blank document

2) added dataprovider

3) added query specification

4 saved document

5) refresh document

6) got elements specification using GET from existing manually created pie chart report , those specifications are attached

7) Below mentioned are elements specifications I used except header, body and footer in request body with POST method in order to create pie chart,

I mentioned below specifications one by one and finally saved document using PUT,

<element type="Cell">

        <id>4</id>

        <reference>UIREF:V=1:RID=1:BID=4</reference>

        <parentId>2</parentId>

        <size autofitHeight="true" autofitWidth="false" minimalHeight="1548" minimalWidth="15048"/>

        <position verticalAnchorType="None" horizontalAnchorType="None" y="432" x="7416"/>

        <padding bottom="156" top="156" right="213" left="213"/>

    </element>

element type="Visualization">

        <id>11</id>

        <reference>UIREF:V=1:RID=1:BID=11</reference>

        <name>Block 1</name>

        <parentId>2</parentId>

        <size minimalHeight="11250" minimalWidth="15000"/>

        <position verticalAnchorId="4" verticalAnchorType="End" horizontalAnchorType="None" y="900" x="450"/>

    </element>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 15, 2015 at 03:13 PM

    hello,

    The "GET .../elements" only gives basic/common information about the report elements, and is useful to have a basic graphical idea of the report.

    For more details, you should call "GET .../elements/{elementId}" for each report element.

    Regards,

    eric

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I am able to GET pie chart element details now

      I used same specification and mentioned same   in request body using POST to create pie chart element but getting below error

      pie chart specification:

      <element type="Visualization">

              <id>5</id>

              <reference>UIREF:V=1:RID=1:BID=11</reference>

              <name>Block 1</name>

              <parentId>2</parentId>

              <size minimalHeight="11250" minimalWidth="15000"/>

              <position verticalAnchorId="4" verticalAnchorType="End" horizontalAnchorType="None" y="900" x="450"/>

              <style>

                  <alignment wrapText="false" vertical="Bottom" horizontal="Left"/>

              </style>

              <content>

                  <axes duplicateRowAggregation="true">

                      <axis role="Column">

                          <expressions>

                              <formula dataType="String">=[State]</formula>

                          </expressions>

                      </axis>

                  </axes>

                  <chart look3D="false" type="Pie">

                      <legend position="East" visible="true">

                          <style>

                              <border thickness="None">

                                  <color alpha="0" rgb="#000000"/>

                              </border>

                              <font face="Arial" size="8" rgb="#707070" underline="false" strikethrough="false" bold="true" italic="false"/>

                              <background>

                                  <color alpha="0" rgb="#000000"/>

                              </background>

                          </style>

                          <title visible="true">

                              <style>

                                  <border thickness="None">

                                      <color alpha="255" rgb="#000000"/>

                                  </border>

                                  <font face="Arial" size="8" rgb="#000000" underline="false" strikethrough="false" bold="true" italic="false"/>

                                  <background>

                                      <color alpha="0" rgb="#000000"/>

                                  </background>

                              </style>

                              <alignment vertical="Center" horizontal="Left"/>

                          </title>

                      </legend>

                      <title visible="false">

                          <style>

                              <border thickness="None">

                                  <color alpha="255" rgb="#000000"/>

                              </border>

                              <font face="Arial" size="9" rgb="#000000" underline="false" strikethrough="false" bold="true" italic="false"/>

                              <background>

                                  <color alpha="0" rgb="#000000"/>

                              </background>

                          </style>

                          <label dataType="String">=&quot;My Title&quot;</label>

                          <alignment vertical="Center" horizontal="Left"/>

                      </title>

                      <dataLabels dataType="Auto" visible="false">

                          <style>

                              <border thickness="None">

                                  <color alpha="255" rgb="#000000"/>

                              </border>

                              <font face="Arial" size="8" rgb="#707070" underline="false" strikethrough="false" bold="true" italic="false"/>

                              <background>

                                  <color alpha="0" rgb="#000000"/>

                              </background>

                          </style>

                      </dataLabels>

                      <plotArea visible="true">

                          <color alpha="255" rgb="#ffffff"/>

                      </plotArea>

                      <floor visible="false"/>

                      <palette name="SAP Standard 2011"/>

                      <feeds>

                          <feed id="PieSectorColor">

                              <expression>

                                  <formula dataType="String">=[State]</formula>

                              </expression>

                          </feed>

                          <feed id="PieSectorSize">

                              <expression>

                                  <formula dataType="Numeric">=[Sales revenue]</formula>

                              </expression>

                          </feed>

                      </feeds>

                  </chart>

              </content>

          </element>

      __________________________________________________________________________________

      Error:

      1. <error>
      2.    <error_code>999</error_code>
      3.    <message>Internal error (RaylightAction)</message>
      4.    <stack_trace>com.sap.webi.raylight.RaylightException: Internal error (RaylightAction)&#13;
      5.   at com.sap.webi.raylight.context.Messenger.internalError(Messenger.java:83)&#13;
      6.   at com.sap.webi.raylight.actions.ActionDispatcher.handleUnexpectedError(ActionDispatcher.java:131)&#13;
      7.   at com.sap.webi.raylight.actions.ActionDispatcher.invoke(ActionDispatcher.java:117)&#13;
      8.   at com.sap.webi.raylight.RaylightServiceReportElements.createReportElement(RaylightServiceReportElements.java:105)&#13;
      9.   at sun.reflect.GeneratedMethodAccessor270.invoke(Unknown Source)&#13;
      10.   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&#13;
      11.   at java.lang.reflect.Method.invoke(Method.java:597)&#13;
      12.   at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)&#13;
      13.   at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)&#13;
      14.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:164)&#13;
      15.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:242)&#13;
      16.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:242)&#13;
      17.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:242)&#13;
      18.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:242)&#13;
      19.   at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:91)&#13;
      20.   at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)&#13;
      21.   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)&#13;
      22.   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)&#13;
      23.   at java.util.concurrent.FutureTask.run(FutureTask.java:138)&#13;
      24.   at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)&#13;
      25.   at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)&#13;
      26.   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)&#13;
      27.   at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)&#13;
      28.   at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102)&#13;
      29.   at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464)&#13;
      30.   at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)&#13;
      31.   at com.sap.bip.rs.server.servlet.BIPServletController.invoke(BIPServletController.java:93)&#13;
      32.   at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)&#13;
      33.   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)&#13;
      34.   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)&#13;
      35.   at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)&#13;
      36.   at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)&#13;
      37.   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)&#13;
      38.   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)&#13;
      39.   at com.businessobjects.sdk.actionfilter.WorkflowFilter.doFilter(WorkflowFilter.java:45)&#13;
      40.   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)&#13;
      41.   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)&#13;
      42.   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)&#13;
      43.   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)&#13;
      44.   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)&#13;
      45.   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)&#13;
      46.   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)&#13;
      47.   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)&#13;
      48.   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)&#13;
      49.   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)&#13;
      50.   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)&#13;
      51.   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)&#13;
      52.   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)&#13;
      53.   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)&#13;
      54.   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)&#13;
      55.   at java.lang.Thread.run(Thread.java:743)&#13;
      56.   Caused by: java.lang.reflect.InvocationTargetException&#13;
      57.   at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)&#13;
      58.   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&#13;
      59.   at java.lang.reflect.Method.invoke(Method.java:597)&#13;
      60.   at com.sap.webi.raylight.actions.ActionInvoker.invokeWith(ActionInvoker.java:123)&#13;
      61.   at com.sap.webi.raylight.actions.ActionDispatcher.invoke(ActionDispatcher.java:105)&#13;
      62.   ... 48 more&#13;
      63.   Caused by: java.lang.NullPointerException: while trying to invoke the method com.businessobjects.rebean.wi.model.reportspec.IRSAxis.getExpressions() of an object loaded from local variable 'sdkAxis'&#13;
      64.   at com.sap.webi.raylight.business.impl.ElementHelperFromRaylightToRebean.convertAxis(ElementHelperFromRaylightToRebean.java:458)&#13;
      65.   at com.sap.webi.raylight.business.impl.ElementHelperFromRaylightToRebean.convertContent(ElementHelperFromRaylightToRebean.java:369)&#13;
      66.   at com.sap.webi.raylight.business.impl.ElementHelperFromRaylightToRebean.convert(ElementHelperFromRaylightToRebean.java:261)&#13;
      67.   at com.sap.webi.raylight.business.impl.ElementHelperFromRaylightToRebean.convert(ElementHelperFromRaylightToRebean.java:313)&#13;
      68.   at com.sap.webi.raylight.business.impl.ElementHelperFromRaylightToRebean.convert(ElementHelperFromRaylightToRebean.java:157)&#13;
      69.   at com.sap.webi.raylight.business.impl.ElementHelper.convert(ElementHelper.java:108)&#13;
      70.   at com.sap.webi.raylight.actions.reportelement.CreateReportElementAction.execute(CreateReportElementAction.java:54)&#13;
      71.   ... 53 more&#13;
      72. </stack_trace>
      73. </error>