[#9151] - Jaspersoft Studio Custom Visualization Bug (Solution Inside)

Category:
Bug report
Priority:
High
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Sometimes
Assigned to:

Hi, I realized a little bug when i using Figures Graph of Custom Visualization Component in Jasper Studio.
When i put this graph on project it produced figures.min.js inside of my project.
When tried to give Items Value = 2 and Items Count = 10 there is a bug inside of code it makes itemsValue same with itemsCount.
I put solution at attachment figures2.min.js and bug is on line 7645 a < f && (f = a); //MUST BE a > f && (f=a)

AttachmentSize
Package icon figures.min.js.bug.zip269.56 KB
v6.3
Custom Visualization Component
ker3m.kuzu's picture
Joined: Jan 26 2017 - 7:00am
Last seen: 2 years 10 months ago

2 Comments:

#1

Hi Kerem, I can't reproduce your bug. But this is how it works in case you set the Show Background Figures to false. I attached the full sources of the component, so you can actually provide, in case, a fix for the real code (not the minimized one). You can import the content of the archive as project in Studio, and run the sample that comes with it.

Let me know if you are able to make it to work as expected.

Thanks!

Giulio

#2

by the way this is the code you were considering to change:

var showPhantom = options.showBackground;

if (items_count < items_value) {
items_value = items_count;
}

The purpose of the if condition here, is to be be sure that the number of figures selected is at maximum the number of figures presented.
In your case you should see 8 figures in grey and 2 in black (total 10 figures)
You made me thinking if this makes actually sense... the answer it really depends by how you want to use the component... we could also may have said:

if (items_count > items_value) // which is when there are not enough items to represent the value...
{
items_count = items_value; // Se the number of items equals to the number of value
}

The reason why I prefer the first option, is that I assume users may prefer to have a specific fixed number of persons (for graphical purposes)... but this also is strongly debatable... :-)

Giulio

Feedback
randomness