Vous êtes sur la page 1sur 2

1

Speaker:
Use a drop down menu to change chart axis in Spotfire
In this video Im going to teach you how to use a drop down box to control the value shown on
the category axis of a bar chart.
So heres the data set that were working with. Weve got four columns: Field, Well, Production
Date and Production Value which were showing in barrels of oil per day. You can see that
some of these wells are associated with Field 1 and some of the wells are associated with
Field 2. So if we want to chart the production off of the different fields or for the different wells
we can use a bar chart.
I might want to show the field on the category axis or I might want to be able to show well on
the category axis, but I dont want user to have to click on this and be distracted by the other
options, I just want to have two options: Well or Field. So we can control the category axis
using a property control or a drop down.
In order to do that click New Text Area and that creates a text box - Im going to make this a
little bit smaller so it doesnt take up too much room. And were going to use a property control
so thats this little icon here. So If you hover over it, you see the tool tip that say Enter
Property Control click on that and you get a drop down with a few different options.
Were going to use a drop down list, so click on Drop Down List and that brings up the
Property Controls box. So we need to create a new property control, so click New and well
give this property a name. It can be whatever name you want, just no spaces and no special
characters. So well call it Well or Field and well leave data type as string since were
choosing between two different strings, Well or Field. And well click Okay.
Now theres a few different options to set the property value through so you can do the column
selection, you can choose unique values in a column or a few different options. So since we
have two different columns that were trying to choose between, well do column selection.
Youll see that it brings up all the columns in our data table, but we only want to show two of
these columns so were going to click Select Columns. This brings up another menu where
you can add specific columns into this drop down, but you can see that these are greyed out.
The reason why is because we have to create a new column property to tell Spotfire which
columns to pull in.
So Ill click New and you can call this whatever you want, no spaces or special characters. Ill
call this Well or Field Column and you can see that the data type is boolean, so its either a
one or a zero. So type Zero into this box. If you put in one, its going to automatically pull in
all four of these columns and any time you add a new column to your analysis, like a calculator
column or importing a new column, its going to also pull that column into the property control.
We probably dont want that to happen because we only want to choose Field or Well. So Im

2
going type in Zero click Okay and then we can add both of these fields. So click on the box,
click Add, click
onathe
next
onemenu
and to
click
Addchart
so weve
Field and Well. Now we say
Use
drop
down
change
axis ingot
Spotfire
Okay and we can see that this list at the bottom updates to only have these two columns
shown. If you like you can have a none or alternative, but for this example it doesnt really
make sense to have none, so well say, Okay.
So you can see that weve got this box but I cant do anything with it right now because the text
area is still active. So Ill click out of it and now when we go back in there we can click this and
we see this drop down with Filed and Well. So you can go back and forth between Field or
Well, but at this point the drop down list isnt doing anything because we havent assigned that
property to anything within Spotfire, so well do that next.
Right click on the category access selector and were going to say, Set from Property so click
that and it brings up this menu. Since we only have one property created for this field, its the
one that we just created Well or Field, select that and say Okay and now you can see that
once you set it as a property you dont have the option to change it from here. So we can right
click and set from a different property if we wanted or we can remove it. But as soon as you set
it as a property it doesnt give you the option to add anymore columns to the category axis.
So now you can see that we have Field down here and we have Field selected in our drop
down. So if we want we can change this to Well and the chart dynamically updates to show the
six different wells.

[Audio ends at 0:05:04]

Vous aimerez peut-être aussi