Databases Reference
In-Depth Information
<format>${%Value}{numDecimals:1,scale:(1000)|(k)}</format>
<font bold="False"/>
<background enabled="True">
<fill enabled="True" color="White" opacity="0.3"/>
<inside_margin all="0"/>
<corners type="Rounded" all="2"/>
</background>
</label_settings>
</bar_series>
</data_plot_settings>
<data>
<series palette="Default">
<point name="Kate" y="{$kateSales}"/>
<point name="Jackson" y="{$jacksonSales}"/>
<point name="Adam" y="{$adamSales}"/>
<point name="Brent" y="{$brentSales}"/>
</series>
</data>
</chart>
</charts>
</anychart>';
dbms_lob.writeappend( l_chart, length(l_chart_v), l_chart_v);
dbms_lob.close( l_chart );
--
owa_util.mime_header('text/xml', FALSE, 'utf-8');
owa_util.http_header_close;
l_length := dbms_lob.getlength(l_chart);
if l_length > 0 then
while ( l_offset < l_length )
loop
htp.prn(dbms_lob.substr(l_chart, l_amt, l_offset) );
l_offset := l_offset + l_amt;
end loop;
end if;
--
if l_chart is not null then
dbms_lob.freetemporary(l_chart);
end if;
end;
When you look at this code for the first time it might look challenging, but it comes down to
generating the correct XML that AnyChart requires to render a dashboard. You would need to look into
the AnyChart Gallery and Documentation to know what XML is expected.
In this case we hardcode many things—for example, the title and the persons—but you can make
this procedure as dynamic as you like by using more parameters or building more queries to retrieve the
data. Because there is a limit in htp.prn , you have to write a loop to pass the XML back in chunks. The
look and feel of the chart in the above example is defined by a string, the data is retrieved from the
salespp table, and you build the XML using the XML DB feature as we have done in previous examples.
Looking closer into the XML of the dashboard, AnyChart supports interactivity by defining Actions.
We defined an action when a user clicks on the map to refresh the two detail charts of the products and
persons. In a dashboard, AnyChart calls them views. So there is only one Flash Object, but because the
Search WWH ::




Custom Search