# Spotfire Functions – Lines & Curves – Curve Draw

• Would you like to know more about how to use the curve draw function?
• Would you like to create your own decline curve in Spotfire?

As promised, this week’s post will discuss Curve Draw, one of the four Lines & Curves features showcased last week, but only at a high level.  This week, I’ll go a bit deeper into Curve Draw starting with an example to show how it works, and then I’ll move on to a more functional example.

To recap from last week, curve draw will plot a line based on an equation specified by the user where y is a function of x.  In the example below, I am plotting a line that is 2 * x.

Things to know about curve draw

Here is an example of the Curve Draw being used with the simple expression y = 2*x.  Y is very clearly a function of x. Here is an example of the log function being used to draw lines.   The expression is provided as a label in the visualization. Now that I’ve explained what Curve Draw does, let’s look at another example.

In the screen shot below, I have created three input property controls named Qi, Di and bfactor that will be the inputs into a hyperbolic decline curve.  I used the Curve Draw function with the expression shown below to calculate the decline.  The expression is referencing the property controls using the syntax \${PropertyName}.  Note that the expression uses the x axis value, which is time in number of months.  Also notice that there are two parts to the expression, which I have indicated with different colors.  The only difference between them is that the first part is looking at x and the second part is looking at x-1, so the calculation is subtracting the result of month 2 from the result of month 1 and so on.

\${Qi}/((1-\${bfactor})*\${Di})*(1-((1+\${bfactor}*\${Di}*x)^(1-1/\${bfactor}))) – \${Qi}/((1-\${bfactor})*\${Di})*(1-((1+\${bfactor}*\${Di}*(x-1))^(1-1/\${bfactor}))) Next week I will discuss Curve from Data Table.

### 10 thoughts on “Spotfire Functions – Lines & Curves – Curve Draw”

1. Pattranun Reply

Is there any way to reset the position of label for draw line and curve label?

• Julie Sebby Post authorReply

Unfortunately not. It has been suggested as an idea for improvement. I would upvote this idea — https://ideas.tibco.com/ideas/SPF-I-688 — and add a comment that you would like to be able to move labels from lines and curves as well.

2. Chad Holland Reply

Is there are way to terminate the line at a 0,0 origin position? For instance, creating a custom axis?

• Julie Sebby Post authorReply

There is a way to do that. Someone asked me that in one of the first weeks I ever worked support. I will have to dig to find that answer though.

• Julie Sebby Post authorReply

Do you want to terminate a curve draw line specifically?

• Caleb Reply

Is there any update on the post you had put together in the past? I’m interested in beginning and terminating curves at specific locations, i.e. 0,0 in curve draw

3. Naresh Reply

Can we color lines and curves labels with different colors?For instance I have 3 horizontal lines with different colors, I need to color these horizontal line’s labels with three different colors.

Thanks in advance!

• Julie A Sebby Reply

Unfotunately the application does not allow that with out of the box functionality. You might be able to do label coloring with CSS, but I know you won’t be able to make the labels different colors because the labels will all be the same object that is formatted.