Images in Bar Chart
Download: Images in Bar Chart
NOTES: This plugin works with Sisense version 6.6.1 or later.
This Plugin adds additional functionality to bar charts, allowing them to show custom images in the end of each bar. This could be useful to make, for instance, leader boards look more attractive.
The result of applying and configuring plugin is shown below.
Configure plugin
To make plugin you need to make next steps:
- Make sure your elasticube table contains the column with all required images for every row;
(it is okay if some rows won't have image - if this rows will be shown in the charts, image just won' render) - Create new custom field in elasticube, using two columns 1 - the column you initially wanted to use as
a category, 2 - the image url table. Combine this 2 columns using next SQL expression: IfString([photolink] != NULL, [name] + '---' + [photolink], [name] + '---') See image below:
as a result you should have column, which has something similar to line below in it's rows:
Name Surname---http://www.example.com/example.png
- Go to Sisense and create bar chart with the field generated on step 2 as category, and random number of values
Select on of the values in the panel you want attach image to, open it's menu and click Use For Image menu item:
Now you will see images appearing in the end of bar items for which data-items in elasticube image url was specified.
Notes regarding images usage
- Plugin supports .png .jpeg and .gif file extensions.
- Although https links could be used as image sources, it may cause inappropriate behaviour, thus usage of http links is recommended
- Local images can be used. To make it work place images under /images folder under the plugin folder and use next links in elasticube: /plugins/imagesInBarChart/images/<imageNmae>. The folder could be different but in this case links in elasticube should be added appropriately
Notes regarding CSV export
As widget is using newly generated field as a category, when exporting to csv you will see generated field which contains Name and link in each row instead of just Name. If csv export is critical follow steps below to change field with name and link to name field.
- Open widget edit script view.
- Enter next code in opened editor:
prism.swapFields(widget, {fieldToBeChanged: "[Sheet1.NamePic]", fieldToBeUsed: "[Sheet1.name]"})
where [Sheet1.NamePic] - is the name of field with names and links, and [Sheet1.name] - is a field with names only
Limitations with exporting to image
Export to image from widget view is not working due to limitations in third party library used to export html to png.
Dashboard export to pdf and png is working fine.
-
I've installed the plug in on Sisense 6.5 and the plugin has cause all sorts of errors the existing dashboards. The main one being, all my image widgets stopped working. The image widgets are very important for our organisation. Has anyone else experienced this problem? I had to delete the plug in to restore dashboard operations.
Please sign in to leave a comment.
Comments
3 comments