The SAS Graph Builder will allow you to join graphs together and steal properties from two different graphs and create a new graph using them. Or overlay graphs on top of each other, or just create graphs that share rows, maybe x-axis or y-axis rows. So lots of scopes. And let’s have a look at a practical example. OK. So here we’ve got a line chart, nothing special, the box line chart showing join month across the bottom, and a total number of members up the side. In SAS Visual Analytics, line charts, there’s no way of annotating data points unless you took a screenshot of it and started scribbling on your important data. In this example, sometime around June, I’ve highlighted it as important. So I’ve scribbled it on. However, SAS Visual Analytics is a reporting tool for dynamic data. The data should refresh, and you don’t need to recreate the report every time. So that’s not the ideal solution. What we can do is we can use the SAS Graph Builder to define a new chart template, get the role of a data label in, and it will allow us to add annotations to the line chart. So here’s a screenshot of the SAS graph builder.
It’s an application. It looks quite similar to the Visual Analytics layout, so it’s user-friendly. On the left-hand side, you’ve got your Graph Elements. Each of those is the template that you can start with. You can drag them onto the middle, overlay them on top of each other, and then use properties from both to create your final graph. The graphs we’re using for this example are a line chart and a series plot. We’re using the series plot because it doesn’t allow your date on the x-axis, so we can’t use that straight away. However, it does have an extra row for a data label so you can annotate data points. We’ll combine the two, take the rows from the line chart, the data label from the series plot. So we’ve added them both into the middle. On the right-hand side, we can control what lines– what rows are going to be in the output. To start off with, the line chart we’ll leave as it is, and the series plot we want to add a row. So we can add any extra rows. Each chart will have different rows available. On this one, the row we want is a data label. On top of that are loads of different options you can specify. In fact, there are plenty more options here than by default in the Report Designer. So at this point, you’d go through and choose all the properties, how you want the x-axis, the y-axis, and the data itself to look.
We’ll color the line chart as normal, and we’ll color the series plot as white so it’s hidden in the background. We don’t want our lines duplicated. We only want to highlight the labels used in the series pilot. When you’re done, save it, and then you can share that object between any users that you want to and import it into your objects pane. So I’ve saved it as a line chart with a time flag, and now it’s ready to use, just like any other object in your report. Drag it on and add your data to it, and here is our embellished line chart. We’ve got our line chart data from before, but we’ve added onto it our data labels. The rows on the right-hand side, as you can see, are very similar to any other objects you’d use. At the bottom, we’ve got the data label we added. In this example, we’ve chosen to flag up June of each year. So we’ve got June 2016, ’17, and ’18 highlighted as markers. Essentially, you could have put any data into that to highlight whatever was required. To summarize, the SAS Graph Builder is a really good application to help you enhance the graphics that you’re creating. The new templates can be used in your report and also shared between any number of users, and they can use them as well. So it’s a one-time task, creating all your new graphs templates. It’s a quick way, and it’s also in your native SAS Interface that you should be familiar with if you’re using SAS Visual Analytics.
So it’s a really good place to start to try and expand how much you can do in your reports. OK. So the last thing that we look at is data-driven content. Data-driven content is an object in the default SAS Visual Analytics that allows you to embed a third-party application visual inside your Visual Analytics report. It allows you to embed basically any JavaScript-based visual. You can develop your own from scratch if you have the skills or know someone that has the skills, or you can use ones that are already available. There are tons of libraries of shared graphs already out there. Essentially, you’d use the data-driven content object to do one of two things. One maybe brings in a graph that already exists but has properties that aren’t available by default in SAS Visual Analytics. The other option is bringing in completely new graphs. So if your graph doesn’t exist, the way you want to present your data does not exist as a default graphic in SS Visual Analytics, you can create it and bring it in. The great thing about this object is the graphs you create work exactly like your SAS Visual Analytics objects. When you import them into your report, they’ll interact. They’ll be able to be filtered. You can add the data exactly as you are when you’re using a normal SAS Visual Analytics object. OK, so we’ll have a quick look at an example. First of all, we’ve picked D3.
There are lots of JavaScript libraries you can use, but we’ve found that D3 brings probably the newest functionality to reports. And if you are familiar with HTML, it’s not too difficult to learn. So I’ve got a quick video of a D3 graphic that we’ll be using in a SAS Visual Analytics report. The graphic at the moment is not in VA. It’s just on an internet page and it has hard-coded data in it. When we bring it into VA, we’ll want to address that. We’ll want to embed it in the report, and we’ll want the data coming from VA. So first of all, let’s have a look at the graphic. OK. So here’s a bar chart. You can’t have a bar chart in Visual Analytics, so we’re using a graph that already exists but adding functionality that isn’t there in a default bar chart. In this case, as you hover over the bars the surrounding bars dynamically change color. And as you move the mouse away, they’ll change back to their original color. So the functionality we’re adding in is called On Mouse Hover. As you hover your mouse, something happens. I said that that graph has hard-coded data in it. If you want to bring it into SAS Visual Analytics,
We need to make two changes to the code. We’re not going to go into the code used to create the graph. That code and the code that is adapted are all available on the SAS Global Forum GitHub if you want to have a look at it in more detail. But I thought I’d pick out the two really important bits of information that you’ll need to know if you are creating D3 graphs yourself. First of all, is a listener. That graph I just showed you reacts as your mouse hovers over it. The listener is part of the code that’s listening for the movement, the reaction, and the interaction from SAS Visual Analytics. So that needs to be part of your code to make sure the graphs are interactive. The data receiver is the second important thing. We want to be able to pass data from SAS Visual Analytics into the object, and we want the object to render the graph showing that data dynamically and every time we look at the report. So that data receiver replaces hard-coded data or wherever else the data is and will allow the data to be passed from SAS Visual Analytics.
Getting that graph into your report. So last of all, we need to save the code on your SAS Viya server. There is a specific folder to save it in. Once you’ve done that, add the object into your report, specify the web content URL in the Options tab to point to the graph that you’ve saved on your SAS Viya server. The last thing to do is at the data rows. So it’s just like a normal graph now we’ve embedded it. The data rows expect variables. The variables are dependent on how you’ve coded the graph. So in this case, I’ve added gym names and total members. In the report, the graph will automatically interact with any other objects. So we’ll have a look at a quick video of a bottom bar simply interacting with the graph we’ve created. As you click on the bottom bar, it will filter down to the bar chart. The bar chart looks like a native SAS Visual Analytics graph.
You have to wait 15 seconds.
Generating Code…
What i don’t understood is in reality how you’re now not really a lot more smartly-favored than you might be now. You’re very intelligent. You understand therefore significantly in terms of this topic, produced me personally believe it from a lot of numerous angles. Its like women and men are not interested except it is one thing to accomplish with Woman gaga! Your own stuffs outstanding. Always care for it up!