Home Analytics Designing reports
The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

BIRT_retrieving Data (from Data sets) in scripted Chart

edited September 18, 2019 in Designing reports

Hello everyone,
I'm using BIRT All-in-one Version working on a report where i created a chart using script. I added a chart through Chart-builder( any charts type), and then went to the script button and in the beforeGeneration() i coded the chart and changed it's type to Bar chart

When you open my attached report, you'll see on the Layout a scatter chart, but when you view the report it displays a bar chart which i programmed in the script window.

Here i'm using s scripted data source.

but If you look into the script, you'll see that I've added custom Data per Hand like (A,B,C.....) and numbers like (244,250.....)

Now the question is : How can I a retrieve the data from my Data set ,that i created into the Chart-script. ????

Please see the following picture for better Understanding. Also the example is attached with this post.

Looking forward for some help and thanks in Advance

Khaled

Comments

  • Hi Khaled,

    I don't know of a way to get the Data Set values in beforeGeneration. However, this works:

    function afterDataSetFilled( series, dataSet, icsc )
    {
      importPackage(Packages.java.util);  
      var list = Arrays.toString(series.getDataSet().getValues());
    }
    

    The event triggers for both the X-axis and the Y-axis. Each time it returns an array of data for the Data Set column assigned to the axis.

    Jeff F.
    Customer Support Engineer I
    OpenText
  • One thing I forgot to mention is that if there are two completely different charts, it is probably easier to create two chart elements and use visibility rules to determine which one to display.

    Jeff F.
    Customer Support Engineer I
    OpenText
Sign In or Register to comment.