The Chart EndPoints are used to create charts with D3.js

1 Usage of a Chart EndPoint

The endPoints of type Chart can define a bar chart and render it.

2 Example of Chart EndPoint

To create a chart endPoint we will add the following code to the appConfiguration.xml document.

2.1 Basic Chart EndPoint

The data used for this example is asked with the following SQL query:

Copy

SQL Query

<select>
    <columns>
       <cast type="integer">LPAD(MONTH(galmvalo.fecval),2,'0')</cast> valor, SUM(galmvalo.stock * galmvalo.coste) valor2
    </columns>
    <from table='galmvalo'/>
    <where>
        galmvalo.fecval BETWEEN MDY(1,1,2012) AND MDY(12,31,2012)
    </where>
    <group>1</group>
    <order>1</order>
</select>
Copy

appConfiguration.xml

<endPoints>
    <endPoint type="CHART" title="TITLE_STOCKVALUE" path="stockValue">
        <dataSQL>frontend_stockValue</dataSQL>
    </endPoint>
</endPoints>

The result will be the following:

SQL Query data

Note: The chart always represents the columns valor vs valor2, and both of them must be of type numeric (Integer, Double...), otherwise the graph won't be displayed