-
kurtApril 13, 2019 at 1:02 pm #11894
Hi Tom, I am attempting to implement your BarChart into a Cognos report using a Custom Control.
I am using the Vizuly in HTML Tutorial from the docs to keep the complexity down. I am using the static data in the example as well.
When the report runs I get the following error:
ReferenceError: vizuly2 is not defined BarChart:37:1I’ve tried require to resolve the dependency without success.
Here is the custom control code:
define( ["jquery","../lib/d3_v5.7.min.js","../lib/vizuly/core/vizuly2_core.min.js","../lib/vizuly/BarChart.js"], function( jQuery, d3, vizuly2, BarChart ) {"use strict";
function BarChart(){};
BarChart.prototype.initialize = function(oControlHost, fnDoneInitializing) {
fnDoneInitializing();
};BarChart.prototype.draw = function( oControlHost ) {
var viz = vizuly2.viz.BarChart('#v16');var data = [
[{'stock': 'In Stock', 'fruit' : 'Apples', 'value': 10,},{'stock': 'In Stock', 'fruit' : 'Peaches', 'value': 15},{'stock': 'In Stock', 'fruit' :
'Pears', 'value': 20}],
[{'stock': 'Out Of Stock', 'fruit' : 'Apples', 'value': 4,},{'stock': 'Out Of Stock', 'fruit' : 'Peaches', 'value': 8},{'stock': 'Out Of Stock',
'fruit' : 'Pears', 'value': 30}]
]viz
.data(data)
.width('100%')
.height('100%')
.x(function (d, i) { return Number(d.value); })
.y(function (d, i) { return d.fruit; })
.seriesLabel( function (d,i) { return d.stock })
.updateOnResize(true)
.update();};
return BarChart;
});
Can you help?vizulyApril 23, 2019 at 12:11 pm #11896Hello Kurt,
This is most definitely an issue with how Vizuly is being imported by Cognos and potentially it not finding the files correctly.
In the past when working with Cognos, I have seen issues with the relative path not being correct, as the location Cognos deploys the report to might not have the same relative location to the paths you are defining for Vizuly in development.
One way to check this is to run the report in the browser, and see the URL in the browser bar. Then (in the use case above) see if you can point the browser to these files which are located in the PARENT directory.
So if your report is running at ‘https//134.43.155/reports/test/..’ see if you can find the files in ‘https://134.43.155/reports/lib/vizuly/core/vizuly2_core.min.js’. In this case substitute the URL for the actual one in your reports.
If that doesn’t help resolve the problem, I am happy to provide some priority support and we can do a web call with screen share so I can help you debug the configuration issue.
Cheers,
Tom
-
|
You must be logged in to reply to this topic.