Quantcast
Channel: SCN : All Content - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4216

Design Studio 1.2 SDK - Creating a custom donut component

$
0
0

While this is not the first component I have created it's proving to be a versatile component that I wanted to share with the community.  If you're using Design Studio 1.3 you now have the ability to use and configure a donut component but for those of us stuck with 1.2 the only option is developing in the SDK.

 

This particular component took under two days to build, with the bulk of that time spent on the finer details such as positioning the text, sizing the arrow, ....  It's fully configurable for its intended use but additional settings could easily be added if required (ie. text color, "donut-hole" color, shadow, etc...):

 

Design Studio SDK - donut img1.JPG

Image 1

 

 

As I do with components where it makes sense I also added the following three events:  On Click, On Mouse Over and On Mouse Out:

Design Studio SDK - donut img2.JPG

Image 2

 

Linking a donut component to a detailed WebI is simply a matter of adding code to the On Click event, for example.

 

The display of both the arrow and the "From" value below the donut are triggered by setting the Previous Value.  With a value of "-1" neither are displayed; anything other than will cause both to appear.  It's important to note no data validation is done as I've assumed the dashboard developer will set reasonable percentage values.  The donut will not break if, for example, a value of 200 is used but it will display no differently from using 100.

 

While the logic to determine the arrow direction and color is not handled within the component it could easily be accomplished.  As it is a developer explicitly sets both the color and direction of the arrow (see Images 3 & 4 below):

 

Design Studio SDK - donut img3.JPG

Image 3

 

Design Studio SDK - donut img4.JPG

Image 4

 


The code is quite simple and I have uploaded the two base files here: https://github.com/davelr/Design-Studio-SDK-Custom-Donut

 

Having not yet seen the donut in DS 1.3 I would be very curious to know how it compares.  I welcome any feedback you may have.


Viewing all articles
Browse latest Browse all 4216

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>