1

I am trying to create a bar graph using Forena's SVG Graph facilities. But it shows output like this:

enter image description here

As shown in the above image, it is not rendering the SVG Graph properly.

I am using this SQL statement (my "data block" related to the SVG Graph I try to create):

SELECT Type,count(*) as Number
FROM node
GROUP by type

Following is a screenprint of the related FRX file:

enter image description here

And here is a textual version of that FRX file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY nbsp "&#160;">
]>
<html xmlns:frx="urn:FrxReports">
<head>
<title>Graph Demo</title>
<frx:category>Sample Graph</frx:category>
<frx:options/>
<frx:parameters>
</frx:parameters>
<frx:docgen>
</frx:docgen>
<frx:fields>
</frx:fields>
<frx:menu/>
<frx:cache/>
<style/>
</head>
<body>
<div id="nodeGraph" class="FrxSVGGraph" frx:block="reports/nodeGraph">
  <svg frx:group="{Type}" frx:key="{Type}" frx:series_1="{Number}" frx:renderer="FrxSVGGraph" frx:type="BarGraph"/>
    <table>
      <thead>
        <tr>
          <th>Type</th>
          <th>Number</th></tr></thead>
      <tbody>
        <tr frx:foreach="*">
          <td>{Type}</td>
          <td>{Number}</td></tr></tbody></table></div></body>
</html>

My question: How to make Forena render my SVG Graph properly?

0

1 Answer 1

1

The issue you described in your custom graph, is pretty sure similar to what is also happening when viewing the delivered graphs. So make sure that the delivered graphs work before moving on to custom graphs, such as the SVG Graph Demo, which is one of the delivered SQLite sample reports and graphs. Visit relative path /reports/sample.svg_demo in your own site. If you don't get the very same graphs in your own site, then use this checklist to get that issue resolved:

  • After you installed/enabled Forena, complete the required setup to Enable SVGGraph library (reports/help.setup#svggraph in your own site is where you can find the same). Pay special attention to this part documented around there:

    If you don't see a nicely formatted graph, but only some square with a gray background (about the size of the SVG graph you should see if it would have worked), or you're getting some error messages, you may want to checkout the issue queue on Drupal.org (search for html filter) ...

    Obviously, if you change "gray" to "white", your first screenprint is pretty similar to "... some square with a gray background ..." (more details on that "html filter" in the next bullet).

  • Quite often the reason why Forena doesn't seem to render SVG Graphs correctly, is because the input format used by Forena is simply stripping out the SVG tags. To remedy this, this is what's needed:

    go to admin/config/content/forena in your site and ensure that the Text Format specified does NOT strip out SVG tags.

Additional info: have a look at "Prepare a text format to be used by forena" within the Installation and Configuration section of the Setup guide. At the very end of it there is this note:

Especially if you're planning to use SVG graphs it is important to avoid that tags are being stripped out, as this could cause such graphs to not be shown at all or with errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.