Create Diagonal Lines with Sparkline Charts in SAP Dashboards

Glancing at the “Art and Backgrounds” category of components in Dashboards 4.0 or earlier versions of Xcelsius you may have noticed that there is a Rectangle, Ellipse, Horizontal, and Vertical Line components available to display on the canvas but no Diagonal Line.

7-22-2013 11-57-55 AM

The first time I came across this omission was when a customer requested to have lines on a map connect between different cities.  As you well know, the closest distance between two points is a straight line but that line won’t always be 100% vertical or horizontal.

I went searching online for any add-ons that may solve this problem. When there wasn’t one readily available, I decided to try and use an existing component in Dashboards to see if it would do the trick.

That brought me to the ‘Sparkline Chart’ component.  I hadn’t really used it before, but the squiggly lines under the icon looked promising.

7-22-2013 11-41-51 AM

Here are the steps I took to create a diagonal line:

(1) First thing is to drag a Sparkline Chart and place it on the canvas.

(2) Click on the ‘Appearance’ section and uncheck the ‘Show Chart Background’ under the Layout tab.

(2) Next, go to the Text tab and uncheck all the labels and titles.

You want to keep your line as simple as possible.  Feel free to choose a color of choice for your line.

(3) Then tag a cell range (A2:A3 for example) as the Data Range under the General section.

(4) Finally, input the value ‘1’ into cell A2 and ‘2’ into A3 and you will end up with a diagonal sloping upwards.

7-22-2013 11-46-48 AM

If you flip the values and insert ‘2’ into cell A2 and ‘1’ into A3, you guessed it, a diagonal line sloping downwards.

7-22-2013 11-48-45 AM

The magnitude of the values are not as important as long as they are not equal and the slop of the line can be adjusted by increasing or decreasing the height or width of the sparkline component.

So the lesson learned here is that, with Dashboards 4.0, the shortest distance between two points is not necessarily a straight line but a sparkline.

7-22-2013 11-51-20 AM





Leave a Reply