Implementing Jaspersoft Studio Community (v6.2.2) Custom Visualisation Component showing Highcharts chart

非 Y 不嫁゛ 提交于 2020-01-04 06:11:06

问题


I want to use Highcharts within a Custom Visualisation Component for Jaspersoft Community 6.2.2. The basic setup (JSON file for basic configuration and Javascript file for executing the actual visualisation) is clear to me. Examples work in my setup. However, I don't understand what to write in the Javascript file to make Highcharts work. Basically, I am looking for Javascript code like:

define('example', ['https://code.jquery.com/jquery-3.0.0.js','http://code.highcharts.com/highcharts.js'], 
function ($, Highcharts)     
{

    return function (instanceData) {    

        $('#container').highcharts({
          chart: {type: 'bar'},
          title: {text: 'Fruit Consumption'},
          xAxis: {categories: ['Apples', 'Bananas', 'Oranges']},
          yAxis: {title: {text: 'Fruit eaten'}},
          series: [{name: 'Jane',data: [1, 0, 4]}, {name: 'John',data: [5, 7, 3]}]
        });

    };

});

Any idea how this should look in order to show the Highcharts chart in Jaspersoft? Help appreciated.


回答1:


I am assuming you have already setup requirejs and phantomjs in your machine. If not then you can refer this or this.You can download CVC high charts example from here where you can also find few other charts example as well as description of circle creation using d3 charts. or you can direct download highchart exmple from here.

Read license document of highchart before utilizing it.



来源:https://stackoverflow.com/questions/37969025/implementing-jaspersoft-studio-community-v6-2-2-custom-visualisation-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!