With the current APEX version you can create nice looking Charts using Anycharts 3. The charts you create with Interactive Reports use Anycharts 4. These charts look better than the regular ones, and we - my colleague Rutger and I - started to investigate the options for enhancing the regular charts. Of course we could wait for APEX 4.0 or go for Anycharts 5, using the Anychart Integration Kit, but we love a quick and more cost neutral (as in 'free') solution...
So let's go:
Create a simple chart using the "SELECT NULL LINK, ENAME LABEL, SAL VALUE FROM EMP ORDER BY ENAME" query. Now make let's make some changes in the generated Region Source to use Anychart 4:
Change
Now replace the standard Chart XML with the very minimal setting of:
Especially the use_anychart3_data_model="true" is important - as APEX generates Anychart 3 type XML. This setting tells Anychart 4 to "understand" that XML. And you're done. Almost...
Update (20/5): The #1085 Error was caused by a wrong "FlashVars" parameter. &APP_ID.:1: should be replaced by &APP_ID.:&APP_PAGE_ID.: Now it works perfect - no need for refreshing the chart anymore!
BTW I am working on a more extensive example on apex.oracle.com, showing more types of charts. I'll do another post when that goes public...
I guess you can't create all the Charts you want, but you can get some nice things like the picture to the left - without any extra costs...
You can see an example here. I wouldn't advice to immediately change all your Charts to Anychart 4, but it is nice to play with!
So let's go:
Create a simple chart using the "SELECT NULL LINK, ENAME LABEL, SAL VALUE FROM EMP ORDER BY ENAME" query. Now make let's make some changes in the generated Region Source to use Anychart 4:
Change
<param name="movie" value="#IMAGE_PREFIX#flashchart/#CHART_TYPE#.swf?XMLFile=#HOST#apex_util.flash?p=&APP_ID.:&FLOW_PAGE_ID.:&APP_SESSION.:FLOW_FLASH_CHART_R#REGION_ID#">to
<param name="movie" value="#IMAGE_PREFIX#flashchart/swf/AnyChart.swf">and
<param name="FlashVars" value="waiting=#FLASH_WAITING#&loading=#FLASH_LOADING#">to
<param name="FlashVars" value="XMLFile=#HOST#apex_util.flash2?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_FLASH_CHART_R#REGION_ID#">twice - once in the <object> section and once in the <embed> section.
Now replace the standard Chart XML with the very minimal setting of:
<anychart>
<settings>
<animation enabled="True"/>
</settings>
<charts>
<chart use_anychart3_data_model="true" >
#DATA#
</chart>
</charts>
</anychart>
Especially the use_anychart3_data_model="true" is important - as APEX generates Anychart 3 type XML. This setting tells Anychart 4 to "understand" that XML. And you're done. Almost...
Update (20/5): The #1085 Error was caused by a wrong "FlashVars" parameter. &APP_ID.:1: should be replaced by &APP_ID.:&APP_PAGE_ID.: Now it works perfect - no need for refreshing the chart anymore!
BTW I am working on a more extensive example on apex.oracle.com, showing more types of charts. I'll do another post when that goes public...
I guess you can't create all the Charts you want, but you can get some nice things like the picture to the left - without any extra costs...
You can see an example here. I wouldn't advice to immediately change all your Charts to Anychart 4, but it is nice to play with!
Comments
The Anychart Integration kit for APEX is free... we don't charge anything for that.
The problem is we couldn't use the Anychart version (3.3 and 4.0) that is licensed with APEX as it doesn't has all features and bugs are not fixed anymore.
Nevertheless you did a good try, I think you looked at what we are doing as you used some unknown parameters ;-)
APEX 4 will give you the new charts too, but it will stay limited and won't include the latest version of Anychart.
Dimitri
I know the Integration Kit is free, but Anycharts is not free.... And sure, I looked at the demo's and discovered the undocumented parameters...
Sure the Integration Kit is free, but that's not really an argument when the version it is integrating with is payed for. The integration kit is not a cost free solution. While the anychart 4 functionality might be inferior to the anychart 5 functionality, I think for about 75% of the time you could just use anychart 4 functionality and charts.
The method Roel described is just the start of our exploration, and I can say that there will be more news on this subject very soon!
P.S. Kudos for what you did with the Integration Kit!
Greetings,
Rutger
I am working on an example with more chart types. Once it is finished I'll post the link.
A big bonus that you've not mentioned is that AnyChart 4 allows the user to save the image as a pdf or a png file just by right clicking - that's something my users are always asking for and until now its been limited to the charts produced by the interactive reports.
Is it possible to explain how you made the bar at the bottom with a Mac look and feel?
Regards Pedro.
For an explanation on the Mac menu thingy: you can click on the fourth icon in that menu (chart + compass) and it'll bring you to another page where that part is explained.
Glad you like it!
Roel
i followed ur example of replacing-anychart-3-with-anychart-4.html but i got error
"NO CHART DATA AVAILBLE "
can u help me in solving this
thanks ,
with regards ,
ram
What type of chart are you using? And what's the query for the chart?
Roel
i m using
Chart (Flash Chart)
this was the query i m using
SELECT NULL LINK, ENAME LABEL, SAL VALUE FROM EMP ORDER BY ENAME
the region source is
param name="movie" value="#IMAGE_PREFIX#flashchart/swf/AnyChart.swf"
param name="quality" value="high"
param name="allowScriptAccess" value="sameDomain">
param name="allowNetworking" value="all">
param name="scale" value="noscale">
param name="wmode" value="transparent">param name="FlashVars" value="XMLFile=#HOST#apex_util.flash2?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_FLASH_CHART_R#REGION_ID#">
embed src="#IMAGE_PREFIX#flashchart/#CHART_TYPE#.swf?XMLFile=#HOST#apex_util.flash?
p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_FLASH_CHART_R#REGION_ID#"
quality="high"
width="#WIDTH#"
height="#HEIGHT#"
name="#CHART_NAME#"
scale="noscale"
align=""
allowScriptAccess="sameDomain"
allowNetworking="all"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
wmode="transparent"
FlashVars="XMLFile=#HOST#apex_util.flash2?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_FLASH_CHART_R#REGION_ID#">
embed>
object>
#CHART_REFRESH#
XML FILES IS :
anychart>
settings>
animation enabled="True"/>
/settings>
charts>
chart use_anychart3_data_model="true" >
#DATA#
/chart>
charts>
anychart>
Mike
You could (or should) try the solution posted on http://apexacp.blogspot.com. That plug-in has far more flexibility and functionality than the one I provided: the solution is based on my post, but uses the APEX Repository definition to create the charts!
Roel
thanks 4 ur great blog.
i've already tried it out->works really great (after some installation hazzle; did'nt have anychart available in the apex/images/flashchart directoty ;-)
but where can i find a users guide (or xml reference). i'm afraid the one at anychart.com does not realy fit the version which comes whith apex 3.2.
i wasn't able to get a legend for an easy query.
i inserted legend enabled="True" Tag to my xml but nothing happend. any idea?
regards
Peter
You can find the Anycharts 4 docs en XML ref here :
http://www.valentinois.net/forums/weatherd/anychart/anychart/help/docs/index.html?Installation.html.
did u get my bug report 4 the acp?
plz have a loook
grtz
peter
I'm also getting the "No chart data available" error when trying to convert to Anychart 4. Would it be possible to post the complete region source code of your working example?
Matthias
I'm getting the same error on apex.oracle.com. I think it has something to do with the upgrade to Anycharts 5 that's now used.
I suggest you take a look at our Anycharts Conversion Package website (http://apexacp.blogspot.com/). That stuff is still working...
Roel
it is possible to use gauges with anychart?
Thanks, Bruno.
In version 5 you can. Look at
http://www.anychart.com/blog/2008/07/24/anychart-50-release-featuring-interactive-circular-angular-and-linear-horizontal-and-vertical-gauges/
They look awesome!
And..in the current APEX version Anychart 5.1.3. is included. So you can use them if you like (using custom XML).
I now installed the APEX ACP package in the parsing schema of my workspace but when I try to convert a v3.3 scatter chart it just displays an empty chart, and the chart shows "version 5.1.3". Are you sure this still works with APEX 3.2.1? I'm almost sure I did everything right.
Matthias
Maybe you can try it with another chart type, like bars or lines?
Roel