Version:

This lesson is part of the Perspective Components and Bindings course. You can browse the rest of the lessons below.

Supplemental Videos

LESSON

Power Chart - Pen Control

Description

In this lesson, we'll take a closer look at manipulating pens in a Power Chart, from the runtime.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] In this lesson, we're going to be focusing on how we can modify a few lower level configurations on our PowerChart. Specifically pens, axes, and plots. Like most of the PowerChart's properties, the user has the direct ability to manage these aspects of the chart configuration from the session. So to get started, I have a PowerChart here that I've made a few configurations on already. I've got two pens on the chart, temperature and pressure, and I'm just showing recent history on them. That said, there are a few things we could stand to improve. For one, our tags are showing values with two pretty different units. So it doesn't make much sense to show them in the same place. Also that the values could fall in pretty different numeric ranges. So we might end up with two pens that are pretty hard to see if they get far enough away from each other on a graph. So let's do something about it. The first thing I'd like to do is move my pressure pen to a separate subplot, to break it out from our other pen. To do that, I'll start by going into preview mode. And then I'll find these settings icon, the little gear icon in the top right corner and click that.

[01:07] And then I'll navigate to the plots tab. And then I'll click add plot. From there I have access to a couple of different properties for our new plot. The first is this relative weight field, which indicates how much vertical space each plot is going to take up. It'll be evaluated relative to the sizes of the other plots where higher numbers get more space. The other property here is a background color for the plot, which we will just leave at white. We also have an Add Marker option here, which allows us to draw horizontal lines or ranges on the plot. I'll just leave that alone for now and click the add button at the bottom of the display. Now let's just say for fun that we want our first plot to be three times the size of our second plot. So I'll click the pencil icon on that first plot, change the relative weight to three, and then click done at the bottom. Now that we've configured our plots, let's set up our pens to actually use them.

[02:03] So we'll navigate to the pens tab. Find that pressure tag and click the pencil icon to change the tags configuration. You can also get into this menu from the table underneath the chart, by hovering over a pen. Now, all I need to do in this interface is find the plot field here and change the value to Plot 1. But let's talk about some of the other features here too. Specifically, we have some properties for controlling with the pen appears on the chart above, but we can also fine tune how we want the pen to appear. For instance, we can control the type of our pen, setting it to something like bar will effectively change the chart type from a line chart to a bar chart. Scatter will avoid drawing lines at all and just plot the points. Now different pen types here will also affect what other properties we see below. In this scatter type for instance, we get to specify the radius of each dots, as well as what we want the colors to be under different conditions, whether the pen has been selected or highlighted and so on. If I change the type back to line, we get to specify how the line should be drawn between points and how we want our line to look.

[03:08] We can even make it a dashed line by specifying a non-zero stroke dash value here. At the very bottom, we can change what tag path we're looking at as well as what historical aggregation mode we're using to process our data. I'll just leave all that alone and click done at the bottom here. And right away, we'll see our second plot come up. Finally, let's also work on our axes a bit. Now I've taken the liberty of setting up an axis already, which is why both of our plots now say temperature data, instead of say pressure data. So let's fix that for our second plot. I'll navigate to my axes tab and click Add Axis. And from there, I'll specify that label setting for the pressure value. So I'll find access label here and say pressure data. Now some of the other settings include how wide I'd like my axes to be and how I want that label to look. I just happen to know that I set my other access label to a 14 point font.

[04:02] So I'll set that here as well. I can also change some colors here, like the colors of my tick marks and the color of that label we just made. If I want to customize the range for the chart, I can uncheck auto range here and type in some numbers, but I'll leave it alone to save my changes. I'll just click add here. The last thing I need to do with my access is configure my pressure pen to actually use it. So I'll find a way back into the pens tab, click the pencil icon next to that pressure pen, change the axis two axis one, and then click done at the bottom. I do want to note that all of the settings we looked at here are also available from the property editor directly and the way we've been configuring things here is also available in the session. There is one hidden property here that's not available in the session though, which is this time access configuration over here. We can change the tick marks and access color of our x-axis from there. So that does it for our coverage of the power charts, pen access and plot properties. We're providing a built-in way here of configuring exactly how your pens should look from the designer or even from the session.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.