Tuesday, May 27, 2014

NextCharts: Display Widget

A new widget was added to NextCharts html5 library: Display.

"Display" shows a value (without min/max boundaries like those used for Indicator) which is associated with a period of time. You can think as example for: Number of site visitors per day, Interest Rate per month, Profit per year.Although, this widget has the possibility to show how this value performed regarding a previous value (on previous period of time).


Json for such widget is like:

{
   "value": "2.354",
   "valueColor":"#004CB3",
   "title":"Visitors",
   "titleColor":"blue",
   "previous":"1.17%",
   "previousColor":"#c0c0c0",  
   "up":true,
   "shouldRise":true,
   "background":"white",
   "shadow":true"
}

Besides title, value and previous values and colors, we can have a background color and some boolean expressions:
- shadow: to show or not a shadow
- up: true for up arrow, false for down arrow
- shouldRise: true to indicate that a rise in value is a good thing, false to indicate that a lower value is a good thing.  For example: a rising number of visitors is good, a lower value of bounce rate is good.

Depending on last two properties we can have a green or a read arrow if the value evolves in the "good" direction or not.

No comments: