This component was designed to display the graph from CSV files. The component will display the data from the multiple columns.
Available two types of graphs:
JPGraph library should be copied to /intranet/csvgraph/jpgraph Download JPGraph library
3. For the both types of graphs we can/should specify the following properties:
If your file includes column names in the first row we must to set up ignorefirstrow attribute equals 1 otherwise 0. It is very important to display the correct graph. The data from the first row will be use to generate a legend otherwise the script will use default settings.
This value will be use if your CSV file does not have any column names.
To display graph with a component templater, paste the following component code anywhere on templater file and set up graph properties.
<component class="CsvGraph" doc_id="2" name="Chart1" ignorefirstrow="1" title="Quarterly Revenue" id="1" type="bar" file="" showlegend="true" width="700" height="300" >
To display graph with a smart object, paste the following component code anywhere on your edited page and set up graph properties.
<script type="text/javascript"> <!-- var smart_graph = {} smart_graph.doc_id="12501"; smart_graph.id=1; smart_graph.name="graph1"; smart_graph.type="bar"; smart_graph.width=500; smart_graph.height=300; smart_graph.showlegend=true; smart_graph.ignorefirstrow=1; smart_graph.title="Quarterly Revenue"; //--> </script> <script type="text/javascript" src="../csvgraph/show_smartgraph.js"> </script>
Discussion