Jump to content

Intersection of two line graphs


Aki

Recommended Posts

I would like to add some sort of mark, such as a vertical line or horizontal line, or a Y-axis value display, to the intersection of the circles.

Intersection.png

Edited by Aki
Link to comment
Share on other sites

Hi Aki, if you have the value of the intersection defined, there are several ways to achieve that:

 

1- Using Lines and Curves Option.

image.png.c5de98d80099f0b44599cd04dbab7f43.png

 

2- Creating a Custom Label Column that has Nulls and a value only at the intersection and use that to display label and also to show marker.

  • Thanks 1
Link to comment
Share on other sites

To find the intersection, you likely need to use a data function. Are your lines straight or do you have some formula that describes them? Or you can use raw data. The method should fit the type of data or formulas you have for the lines.

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, Boris Nachev said:

Hi Aki,

Do you have an example of the .dxp file or a reproducible/example of your dataset? 

Also, could you provide more context on the tools (and versions) you have used ?

Kind Regards,

Boris 

 

Thank you for your comment.
Since the data cannot be taken outside the company, it cannot be shared, but think of the x-axis as months and years and the y-axis as monetary amounts.
The blue line represents sales and the red line represents costs.
May, cumulative sales: 10,000, total cost: 7,000
June, cumulative sales 11000, total cost 7700
July, cumulative sales: 10,000, total cost: 6,900
.
.
.
It's like.
So, although it looks like a straight line on the graph, it cannot be expressed by an expression like y=ax+b.
I want to get the value of the amount when they intersect and draw a line etc. at that value.

Link to comment
Share on other sites

9 hours ago, Atheer Al Attar said:

Hi Aki, if you have the value of the intersection defined, there are several ways to achieve that:

 

1- Using Lines and Curves Option.

image.png.c5de98d80099f0b44599cd04dbab7f43.png

 

2- Creating a Custom Label Column that has Nulls and a value only at the intersection and use that to display label and also to show marker.

Thank you for your comment.
I wanted to calculate the value of the intersection point using the spotfire function.
If you cannot calculate it with spotfire, you can calculate it with another software such as Excel, and you can have the calculated value in the input data. However, since the graph is divided by store using a trellis, it is difficult to calculate the values for each store and enter the calculated values for each store. If spotfire could automatically calculate the value at the intersection, I would like to mark it there.

Link to comment
Share on other sites

6 hours ago, David Katz said:

To find the intersection, you likely need to use a data function. Are your lines straight or do you have some formula that describes them? Or you can use raw data. The method should fit the type of data or formulas you have for the lines.

Thank you for your comment.
Think of the x-axis as months and years and the y-axis as money.
The blue line represents sales and the red line represents costs.
May, cumulative sales: 10,000, total cost: 7,000
June, cumulative sales 11000, total cost 7700
July, cumulative sales: 10,000, total cost: 6,900
.
.
.
It's like.
So, although it looks like a straight line on the graph, it cannot be expressed by an expression like y=ax+b.
I want to get the value of the amount where they intersect and draw a line etc. at that value.

Link to comment
Share on other sites

To recap:

  1. You have two columns with numeric values.
  2. You have a grouping column (store) that you want to trellis by.
  3. Your numeric columns look like two lines for each store.
  4. You want to calculate the best line that fits each one of your columns, for each store.
  5. Then you want the point at which these two fits intersect, for each store.
  6. Then you want to show a horizontal line  for each trellis, at the height of the point where the two (fitted) lines intersect.

Is this a correct understanding? 

  • Like 1
Link to comment
Share on other sites

On 4/26/2024 at 4:48 PM, Gaia Paolini said:

To recap:

  1. You have two columns with numeric values.
  2. You have a grouping column (store) that you want to trellis by.
  3. Your numeric columns look like two lines for each store.
  4. You want to calculate the best line that fits each one of your columns, for each store.
  5. Then you want the point at which these two fits intersect, for each store.
  6. Then you want to show a horizontal line  for each trellis, at the height of the point where the two (fitted) lines intersect.

Is this a correct understanding? 

Thank you for your concern.
This is a sample of the data and an image of the results you want to achieve.sample2.thumb.png.3e96426a14c53e3933e296f086f295bb.pngsample.png.b1777f171c479e267126797acffc832d.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...