Creating a variable width bar chart using JavaScript
A report shows the Unit cost and Unit price of all products. It also works out the Profit Margin from these two.
Business owners are naturally more interested in products with a high profit margin as well as a high unit price.
Getting ready
Create a simple list report with Product, Unit cost, and Unit price as columns.
Also, add a calculated item called Margin to the list to compute the profit margin and define it as follows:
([Unit price]-[Unit cost])/[Unit cost]
How to do it...
In this recipe, we will create a variable width bar chart using JavaScript that shows a bar for every product. The length of bar will indicate the profit margin, whereas the width will indicate the unit price. To do this, perform the following steps:
Drag a new HTML item onto the list report as a new column.
Unlock the report objects using the unlock button. Add four more HTML items in the column where you added the HTML item in the previous step. The report should look...