First of all select metric and attributes that you want to use in your visualization.
Remember that you must specify an object identifier. The example can be label.opp_owner.id.name for attribute (Opportunity Owner) or afSEwRwdbMeQ for fact (Sales Amount).
See the example output below. The data is exported in a raw format. Data is not cross-tabulated. Let’s see how it looks in Javascript.
The key part is the getData() method that calls the GoodData APIs and gives you data result for specified elements.
2. Transform data
In our first tutorial, we didn’t need any kind of data transformation because the data was ready to send to the D3. We need to do this now. This part always depends on what data you are extracting and what type of visualization you want to create. It is a fully custom javascript code.
We basically transform the data to fit the D3.js data input definition. Sometimes this can be quite complex task to solve. In our example we must transform the raw data output that looks as follows:
to the matrix that is being consumed by D3 visualization. Check out the resulting matrix:
What you can see from the matrix above is contribution of each salesperson to the Quarter Revenue. You can see that Andrew Seals brings in 8083016 revenue in the Q1 and 9389679 revenue in Q2. This is what D3 Chord chart needs as the input. If you go row by row, you can see that there is zero value between each quarters and each sales person. It is correct because they are not contributing to each other.
The complexity here is to transform the data we receive from GoodData to this format. This is done by the transformData function.
Setup the D3 Visualization
This part really depends on the visualization type you use. We are using chord chart
That’s it. You are ready to embed your new visualization to the GoodData Dashboard. If you are not sure how to do it read the embedding tutorial.