FusionCharts Forum: XML Data Parsing, chart plotting - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

XML Data Parsing, chart plotting Problem specifying data source to plot

#1 User is offline   Axi0n 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 18-November 09

Posted 18 November 2009 - 10:38 AM

Alright.. First time user as of today...



I am setting up a Nessus / OpenVAS reporting framework and the people over at Hackerstorm.com have some sample/demo scripts with FusionCharts integrated, which is what I am hoping to accomplish...



The process flow is that you select a Scan Ouput .xml file, it parses it, and then outputs a nicely formatted report via CSS.. All the internals are php...



What I don't understand after looking over all the documentation is that all the dataXML methods, etc seem to refer to either a DataURL or an static XML file reference... The PHP internals look as if when a user clicks on any one (if there are multiple XML scan files) that filename is dumped into a variable.. I suppose it would have to be... For the report parsing to work it would have to allow the user to pick an arbitrary file right??



e.g.




include("xml.php");

$scanfile = $_COOKIE["cookie"];

$file = "xml/$scanfile";

$host = isset($_GET['host']) ? $_GET['host'] : 'all';

$xml = new XmlData();

$data = $xml->getData($file);



Now, I suppose the question is... What is my best option for extracting the required data knowing this is the boundary I have to work within...???



Cheers,
Axi0n
0

Other Replies To This Topic

#2 User is offline   Axi0n 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 18-November 09

Posted 19 November 2009 - 11:44 AM

Think I might be getting closer... I read more, but am still very new to the whole web scripting / programming realm...



Another thing I don't understand is... I have an XML file, I am using (or trying) to use the dataXML method... I assume this means that the entire XML is present in the background somewhere...



I have looked at all the examples.. like this for instance which is one provided here...



It does seem as if I can post script code here so I am attaching an example from the docs I am trying to adapt to my needs...



In my case I changed the graph type to FCF_Pie3D...



What I can't get is why would I have to specify values, etc, when the #'s I want are dynamic and in the XML??? I have gone over the source XML and the server side php parsing scripts in as much detail as I can and have tried subsituting just about every variable, tag, etc, and I just don't get any data, or an error loading data...



I read how and why those errors occur, but without me getting the higher order issue it looks like I am completely halted...



Someone, anyone... School a noob??

Attached File(s)


Axi0n
0

Other Replies To This Topic

#3 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1919
  • Joined: 19-March 07

Posted 20 November 2009 - 03:22 PM

Hi,



So far I can understand, it would be parsing $data (using PHP) and get the values from this XML and freshly build an XML that suits FusionCharts needs. You can build the XML as a string and pass it to the chart (dataXML method) or do the whole process in php file separate from the chart implemented file. In the separate file just set the header's content type to 'text/xml' and echo the whole XML string. The chart's implementation would be to using dataURL method as you need to pass the URL of the separate file as setDataURL's source URL.



IF you are using FusionCharts FREE,



you need to set the root element's name as <graph> and instead of 'label' it would be 'name'.;
Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic