cancel
Showing results for 
Search instead for 
Did you mean: 

How to add two (or more) Target/Benchmark lines to a chart?

TheLivingBubba
1 - New Member
1 - New Member

Hi all!

I'm relatively new to Sisense & just finding my way. I've followed the instructions in this post about adding a Target or Benchmark line to a chart (https://www.binextlevel.com/post/add-target-benchmark-line-to-a-chart-in-sisense).

However, I've been asked to find a way to add multiple such lines to a graph, each one to be (preferably) individually configurable by line thickness, pattern, color, etc.),

I would genuinely be so thankful for anything people here can suggest.

Thank you!

2 REPLIES 2

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @TheLivingBubba ,

As you see in the post, the 'ev.result.yAxis[0].plotLines' is an array. So you can add any number of plot lines to it. Here is an example:

widget.on('processresult', function(se, ev){

	ev.result.yAxis[0].plotLines = [
			//benchmark line 1
			{
				color: '#2ec7b5',
				dashStyle: 'LongDash',
				width: 1,
				value: 800,
				zIndex: 5,
				label : {
					text : 'Target1'
				}
            },
		
			//benchmark line 2
			{
				color: 'red',
				dashStyle: 'Solid',
				width: 4,
				value: 2000,
				zIndex: 5,
				label : {
					text : 'Target2'
				}
            },
		
			//benchmark line 3
			{
				color: 'yellow',
				dashStyle: 'LongDash',
				width: 2,
				value: 4000,
				zIndex: 5,
				label : {
					text : 'Target3'
				}
            }
		]
})

And the result is:

harikm007_0-1731007819601.png

Let me know if that works!

 

-Hari

https://www.binextlevel.com/ 

 

 

harikm007
13 - Data Warehouse
13 - Data Warehouse

If you're looking for something fancier, you can try adding bands to the chart.

Refer: https://www.binextlevel.com/post/add-bands-to-line-chart-in-sisense 

harikm007_1-1731008026014.jpeg

-Hari