BookmarkSubscribeRSS Feed
NPashaP
Calcite | Level 5

There are many JavaScript libraries a SAS user can use to create beautiful interactive charts quickly. I wrote a paper a while back in doing this using D3. Now I have created a GitHub repository with various SAS macros I have for creating charts in HTML if anyone wants to use them. Currently, this has only macros for Google Charts but I will be adding various D3 and other JS visualization macros.

 

Have fun visualizing at will!

 

 

 

 

 

 

3 REPLIES 3
Reeza
Super User

That looks awesome! Well done. Is there a way to add multiple graphs to the same HTML file and/or adding text in between? 

 

EDIT: some don't work, like the timeline one. Also, just a heads up, you can read your code directly from GitHub, you don't need to have the code locally as well in myfolders. It'll make your GitHub code, copy/paste/run rather than having to worry about downloading the macro files. This way, we can ensure we're using the latest version of your code without manually maintaining links 😉

%let source_path = https://gist.githubusercontent.com/statgeek/bcc55940dd825a13b9c8ca40a904cba9/raw/865d2cf18f5150b8e887218dde0fc3951d0ff15b/data2datastep.sas;

filename reprex url "&source_path";
%include reprex;
filename reprex;
NPashaP
Calcite | Level 5

You can use HTML iframes to combine multiple charts into a single view or a set of slides after having created each one. I will be creating an example showing how to do it.

 

Good tip on directly reading the macro from GitHub. For anyone who wants to take that route, the code is

filename hzggmacr url "https://raw.githubusercontent.com/haziris/haziris-sas/master/macros/haziris_google.sas";
%include hzggmacr;

Which timeline example isn't working? I had typos on a few of the example links and had fixed them.

 

Thanks!

 

Reeza
Super User
They're all working now 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 844 views
  • 3 likes
  • 2 in conversation