Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

empty

kukabgd May 21, 2019

   

1 answer

1 vote
Benjamin_C__John__Decadis_AG_
Contributor
May 23, 2019

Hello @kukabgd 

this can be done in the JS Layout if the data returned by the groovy script is correctly grouped.

I created an example JS snippet with data that you can insert on the following page to see the format you want: https://c3js.org/samples/chart_bar_stacked.html

var chart = c3.generate({
data: {
columns: [
['c1q1', -30, 200, 200, 400, -150, 250],
['c1q2', 130, 100, -100, 200, -150, 50],
['c1q3', 130, 100, -100, 200, -150, 50],
['c2q1', 130, 100, -100, 200, -150, 50],
['c2q2', 130, 100, -100, 200, -150, 50],
['c2q3', -230, 200, 200, -300, 250, 250]
],
type: 'bar',
groups: [
['c1q1','c2q1'],
['c1q2','c2q2'],
['c1q3','c2q3'],
]
},
grid: {
y: {
lines: [{value:0}]
}
}
});

 

I hope this helps you to get the chart done.

If you have any further questions, you also can use our support portal.

Cheers,
Benjamin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events