Hi,
I want to display a pie chart graph in my report using Javascript.
Is this possible?
Any help will be appreciated
Hi,
I want to display a pie chart graph in my report using Javascript.
Is this possible?
Any help will be appreciated
Hi Sebouh,
you can create a pie chart by calling the method “Context.createChart”. The parameter specifies the type of chart, width and height. In your case for example:
var myChart3 = Context.createChart(Constants.CHART_PIE, 800, 800) // see ArisPieChart
For more information about Reports, check out the Reports & Macros in ARIS group. There are a lot of report tutorials.
Regards,
Eva
Thanks Eva
But Constants.CHART_PIE is not recognized by ARIS
and How can i display the chart in the report, any ideas?
thanks again
Oh sorry, I made a mistake:
var mychart = Context.createChart(Constants.CHART_TYPE_PIE, 800, 800)
To display the chart call the method "OutGraphic":
... //set chart properties, data, ... output.OutGraphic( mychart.getPicture(), 100, 210, 297 ) Return value
I hope this information will help you.
Regards
Eva
Thanks
i did it like this
var pic = myChart3.getPicture(); var sfileName = "11121.png"; var width = pic.getWidth(Constants.SIZE_PIXEL ) * 20 * (100.0/125.0) //twips, correction factor because of excel anomaly (X): * (100.0/125.0) var xCells = width / 1024; var xTwips = width % 1024; var height = pic.getHeight(Constants.SIZE_PIXEL ) * 20*(100.0/133.0) //twips, correction factor because of excel anomaly (Y): \*(100.0/133.0)*/ var yCells = height / 256; var yTwips = height % 256; pic.setZoom(100) // image improvement only(optional) pic.Save(dummyOutput, sfileName); var data = Context.getFile(sfileName, Constants.LOCATION_OUTPUT); var sheet = workbook.createSheet("CHART"); sheet.setPicture ( data, 0, 4, 0+xCells, 4+yCells, 0, 0, xTwips, yTwips); Context.deleteFile(sfileName); Thanks Eva for your continous support
Hi Sebouh,
yes, it is possible with the following method:
chart.setMultiChartType(Constants.CHART_COMBINE_SIDE); chart.setMultiData(aValues, sLegend);
I hope this will help you.
Regards
Eva