9 Replies Latest reply: Apr 29, 2013 7:45 AM by Hilary Farrell-Oracle RSS

    AnyChart pack on Apex

    LéoVic
      Hello everybody!

      I would like to know if someone had already needed to use the AnyChart pack of charts in Apex, I had downloaded the files and saved on my server, together with the
      defaults chart files on apex, and yet I am not getting call the charts into my apex pages.

      I'm using the apex version 4.1.0.00.32.

      If I'm not clear enough, ask what you need to know to understand!

      Thanks!
        • 1. Re: AnyChart pack on Apex
          Hilary Farrell-Oracle
          Hi Léo,

          To assist in addressing your issue, it would be very helpful if you could provide some additional information.

          You have stated that you would "+.. would like to know if someone had already needed to use the AnyChart pack of charts in Apex, I had downloaded the files and saved on my server.....+". When you mention "+AnyChart pack of charts+", what 'pack' of charts are you referring to? Have you obtained a license for the use of additional chart types from AnyChart, and wish to incorporate those files into your APEX installation?

          You also state that you are "+.... not getting call the charts into my apex pages.+". If you have indeed obtained a separate license from AnyChart, accompanied by new chart SWF files, then I would highly recommend that you review the AnyChart User's Guide (see http://anychart.com/products/anychart/docs/users-guide/SimpleChart.html?fromtree) for information on how to create a chart in your application. Please note that charts declaratively created via the Create wizards in Application Express will only support the creation of charts covered by our license agreement with AnyChart, and any additional charts you license separately from AnyChart, will be supported by AnyChart, and must also be manually created in your application. If you take a look at the link I've provided above, you'll see that AnyChart outlines examples of how you can create a chart in your application.

          Regards,
          Hilary
          • 2. Re: AnyChart pack on Apex
            LéoVic
            Hello Hilary!
            At the moment I'm using the Trial Version of AnyChart pack, because first of all I want to know how to use this pack to have sure that it will be useful to me.
            This link (http://anychart.com/products/anychart/docs/users-guide/SimpleChart.html?fromtree) was very useful, tank you very much.
            I've tried to create a sample chart using the example, but is returning only a white square in my page, if you to check this is my code:


            <html>

            <head>

            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

            <title>AnyChart Sample</title>

            <script type="text/javascript" language="javascript" src="http://sistema.datainfo.inf.br:9006/i/flashchart/demochart/js/AnyChart.js";></script>

            </head>

            <body>

            <script type="text/javascript" language="javascript">

            //<![CDATA[

            var chart = new AnyChart('http://sistema.datainfo.inf.br:9006/i/flashchart/demochart/Area.swf');

            chart.width = 700;

            chart.height = 300;

            chart.setXMLFile('http://sistema.datainfo.inf.br:9006/i/flashchart/demochart/Area.xml');

            chart.write();

            //]]>

            </script>

            </body>

            </html>



            thank you for your attention,
            Leonardo!
            • 3. Re: AnyChart pack on Apex
              Hilary Farrell-Oracle
              Hi Leonardo

              I can see you're trying to create an Area chart - that's not one of our licensed chart types, so if you do require the use of such a chart type in your application, then you'll need to contact AnyChart for a license, as I previously mentioned.

              For your tests, however, it might be a good start to add the following to the source of a HTML region on your page:
              <script type="text/javascript" language="javascript" src="#IMAGE_PREFIX#flashchart/anychart_6/js/AnyChart.js"></script>
              </head>
              <body>
                  <script type="text/javascript" language="javascript">
                  //<![CDATA[
                  var chart = new AnyChart('#IMAGE_PREFIX#flashchart/anychart_6/swf/OracleAnyChart.swf');
                  chart.width = 700;
                  chart.height = 300;
                  chart.setXMLFile('#IMAGE_PREFIX#flashchart/anychart_6/swf/anychart.xml');
                  chart.write();
                  //]]>
                  </script>
              </body>
              This simple test will use the version of AnyChart shipped with APEX, and an associated test 'anychart.xml' file. When you run the page, you should see a simple Bar chart. Then all you'll need to do is update the paths to the SWF, JS and XML file so that they point to your test versions. If you have saved the files under the /images folder of your APEX install, then you should be able to reference them by using #IMAGE_PREFIX# i.e. #IMAGE_PREFIX#flashchart/anychart_6/js/AnyChart.js. If you still experience issues getting your chart to display, I would recommend debugging the page to identify what could be causing the problem. If you use Firefox, then the Firebug extension will be very helpful in the debugging process.

              Regards,
              Hilary
              • 4. Re: AnyChart pack on Apex
                LéoVic
                Hi Hilary!

                You had helped me a lot, it's working for me now!

                Now I can test the chart and then get the license :)

                Thak you very much,
                Leonardo.
                • 5. Re: AnyChart pack on Apex
                  LéoVic
                  Hi, Hilary!



                  As I can see, you know a lot off AnyCharts, and maybe you can help me one more time.



                  When you create a chart using the wizard of apex, it asks for a series where I can put the select that will return my data.

                  I tryed to use a, just for test, the xml from chart region to use that series select, and its worked, but the series is from a bar chart and I'm trying to use that in a Area chart, when I execute the region with area chart he looks like bar chart, I noticed that in the series attributes it's possible to change the series type (Bar, Line and Marker). The data that I will show in the Area chart is the same of bar, so what I want to know is if is possible to change the 'series type' for more than only those three options (Bar, Line and Marker) and how can I do this?



                  I'm sorry if I not very clear.



                  Thanks,

                  Leonardo.
                  • 6. Re: AnyChart pack on Apex
                    Hilary Farrell-Oracle
                    Hi Leonardo,

                    For charts declaratively created via the Create wizards in APEX, the generated XML is specific to the type of chart selected. So for Bar charts, the XML will contain <bar_series> tags, which are used to set the attributes of the bar elements on the chart, e.g.
                    <data_plot_settings enable_3d_mode="true">
                      <bar_series style="Default">
                        <tooltip_settings enabled="true">
                          <format>{%Name}{enabled:False} - {%Value}{numDecimals:0,decimalSeparator:.,thousandsSeparator:\,}</format>
                          ...
                          ...
                    AnyChart supports the creation of combined chart types, for example, the ability to create a combined line and bar chart. To support the generation of such a chart, with two different types of series, we have exposed the "Series Type" option on the Chart Series page. This allows customers to set a different series type for each series of data to be represented on their chart, thus supporting the generation of a combined chart. As you've mentioned, the "Series Type" can be set to Bar, Line or Marker. The "Series Type" value is then used to in the <data> tags of the XML, to set the "type" attribute of the <series>, e.g.
                    <data>
                      <series name="SAL" type="Bar" palette="Default">
                        <point name="KING" y="5000"></point>
                        ...
                        ...
                    ...where type="Bar" reflects the setting of "Series Type" on the Chart Series page to "Bar" for this particular example. Given that we don't license Area charts, we do not expose that option. So if you're trying to use the XML for a bar chart in your test to generate an area chart, then you'll need to update those two places in the XML *1)* the <bar_series> tags would need to be replaced with <area_series> information (see AnyChart's online examples for more information here: http://www.anychart.com/products/anychart/gallery/samples/Single-Series-Spline-Area-with-color-interpolation.html) and *2)* replace the type="Bar" with type="Area" in the series data. I would highly recommend reviewing the AnyChart User's Guide and XML Reference for more information - http://www.anychart.com/products/anychart/docs/.


                    Regards,
                    Hilary
                    • 7. Re: AnyChart pack on Apex
                      LéoVic
                      Hi Hilary,

                      Thank you very much for your tips, now I got what I was missing :D

                      Regards,
                      Leonardo.
                      • 8. Re: AnyChart pack on Apex
                        LéoVic
                        Hello!

                        I got how to call the charts and .swf files on my page, thats working but another important think that I'm not understanding how to do, this is how to get the data.
                        Well when I use the default chart with wizard thats ok, I just create the select and the chart call those data and I can see that in the XML of this chart there is a *#DATA#*.
                        I never found a example in AnyChart documentation how to call the data from select they just use data like this:

                        *<data>*
                        *<series name="Series 1">*
                        *<point name="P1" y="15" size="40" />*
                        *<point name="P2" y="15" size="40" />*
                        *<point name="P3" y="15" size="40" />*
                        *<point name="P4" y="15" size="40" />*
                        *<point name="P5" y="15" size="40" />*
                        *</series>*
                        *</data>*

                        I didn't find yet how to use dynamic data only static when I'm not using the wizard.

                        Thanks,
                        Leonardo.
                        • 9. Re: AnyChart pack on Apex
                          Hilary Farrell-Oracle
                          Hi Leonardo,

                          How you choose to generate the XML for charts that aren't covered by our license is totally up to you. You may wish to create your own PL/SQL procedure or page process to handle the generation of the chart XML, ensuring that the generated XML is in the format expected by the chart in question. When charts are declaratively created in APEX, we handle the generation of the XML based upon the chart attributes defined by the user and the results of the chart series query specified. As you are generating your own charts, you'll need to handle the creation of the complete chart XML (including data).

                          As an example, you might find it helpful having a look at https://apex.oracle.com/pls/apex/f?p=36648:109 , where I posted an example of how a customer could generate their own custom map. You'd need to do something similar for your chart, but of course the XML will need to be specific to the chart you are generating, so I recommend that you review the AnyChart XML Reference for assistance - http://www.anychart.com/products/anychart/docs/xmlReference/index.html.

                          Regards,
                          Hilary