For example, people like to see different angles of a bar chart to discover information. First the bar chart may be displayed from left to right alphabetically. Second it is sorted by each category's frequency.
At the web era, a single dynamic bar chart would satisfy those requirements.
In SAS, we can wrap those effects into single macros for repeated usage.
1. Transform SAS dataset to JSON
This time the SASHELP.CLASS dataset in SAS is still used. Since the objective is going to be a simple vertical bar chart, I only transform two variables WEIGHT and NAME into JSON format.
2. Draw the bar chart
The x axis is corresponding to the kids' name from the SASHELP.CLASS dataset, while the y axis is for those kids' weight. The output file is name as vbar.html at the C drive. I add a check box on the top for user to turn on/off the sortable effect on the resulting SVG. Therefore The user will have the freedom to control the bar chart.