![]() I then simply replace #DATA# in the Custom XML with &P1_XML_DATA. I placed this code in Before Header Process and created a hidden Item called P1_XML_DATA within the Chart Region. Running the SQL returns the below (shortened for brevity) which is a typical XML format expected for #DATA# Inspired by Tom Petrus’ Charting Application, I performed some tweaks to what I read, to convert the above SQL to Chart XML. This isn’t one of those blogs which tells you to go off and read the documentation, so now I’ll describe a neat trick I found of converting your SQL to the required format XML. We can’t really see what #DATA# contains, although we do have the An圜hart Documentation, so we know what format of XML it accepts so we can replace it with our own XML. When a Chart is rendered, APEX replaces the #DATA# substitution string with a XML conversion of the SQL results… and voilà the chart is displayed. So if the Custom XML is how the Chart should look, then where is the data? Right down at the bottom you’ll see a #DATA# substitution string. This will ignore any missing points and create a nice smooth line chart for the Commission Series. ![]() Here you can modify the XML to do things like: change how the points are displayed, change what the tooltip says, add the time element to date points, add decimal points, etc., etc. You’ll see that all the chart look & feel settings have been converted to XML… for example, dig deep and you’ll find the name you gave to the chart. So what is this? Well to read the XML you need to select “Yes” to “Custom” and then copy and paste the XML in to an online XML formatter to make it readable. If you haven’t used this yet, then this is the area where you will extend your Charting skills. Right down at the bottom of the page we have a Custom XML section. Take a while to review the all the settings under Chart Attributes and you’ll see that the APEX Team has provided an excellent interface to many An圜hart settings. The Label becomes the X axis and any other columns which appear after the Label appear on the Y axis with their column alias becoming the Series appearing on the Legend. The SQL becomes a Series – a chartable set of data. To recap on the basics, like many components in APEX, you start with a SQL. The charting technology in APEX uses a JavaScript (HTML5) based charting solution called An圜hart and there are plenty of An圜hart examples here. So you may have created several charts within APEX already, and there are plenty of templates available for these such as Line, Bar, Stacked, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |