# Ribbon chart in Ignition Reporting module

**URL:** <https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209>\
**Category:** Ignition\
**Tags:** ignition81, reporting\
**Created:** [April 2, 2024, 10:28am UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209 "2024-04-02T10:28:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arpit\_yadav](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arpit\_yadav](https://forum.inductiveautomation.com/u/arpit_yadav)\
**Post date:** [April 2, 2024, 10:28am UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/1 "2024-04-02T10:28:52Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/be03390de720be9c866b9573c60edb20af029aa7.png)  
Hi, I'm trying to get the same configuration in reporting module how can I achieve the same.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 2, 2024, 3:08pm UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/2 "2024-04-02T15:08:24Z")

</div>

This looks like a stacked bar chart, which you could achieve with the `configureChart` extension function without too much trouble. Look around on this forum for topics that mention JFreeChart and see what you can find.

---

<div class="post-metadata">

**Author:** ![arpit\_yadav](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arpit\_yadav](https://forum.inductiveautomation.com/u/arpit_yadav)\
**Post date:** [April 3, 2024, 6:42am UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/3 "2024-04-03T06:42:00Z")

</div>

@paul-griffith this is what I came up but still unable to get the desired result  
from java.awt import Color  
from org.jfree.chart.plot import PlotOrientation  
from org.jfree.chart import ChartFactory  
from org.jfree.chart.renderer.category import LineAndShapeRenderer  
from org.jfree.data.category import DefaultCategoryDataset  
from org.jfree.chart.plot import CategoryPlot

```
# Create a dataset
dataset = DefaultCategoryDataset()

# Add data to the dataset
dataset.addValue(1.0, "Series 1", "Category 1")
dataset.addValue(4.0, "Series 1", "Category 2")
dataset.addValue(3.0, "Series 1", "Category 3")
dataset.addValue(5.0, "Series 1", "Category 4")
dataset.addValue(5.0, "Series 1", "Category 5")

# Create a line chart
chart = ChartFactory.createLineChart(
    "Ribbon Chart", 
    "Category", 
    "Value", 
    dataset, 
    PlotOrientation.VERTICAL, 
    True, 
    True, 
    False
)

# Set custom colors for lines
renderer = LineAndShapeRenderer()
renderer.setSeriesPaint(0, Color.RED) # Change color as per your preference
plot = chart.getPlot()
plot.setRenderer(renderer)

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 3, 2024, 8:14am UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/4 "2024-04-03T08:14:46Z")

</div>

Hi, arpit. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831). Most of your code got formatted correctly because of four or more leading spaces on the lines but all the imports didn't.

---

<div class="post-metadata">

**Author:** ![arpit\_yadav](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arpit\_yadav](https://forum.inductiveautomation.com/u/arpit_yadav)\
**Post date:** [April 3, 2024, 8:37am UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/5 "2024-04-03T08:37:59Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 3, 2024, 3:01pm UTC](https://forum.inductiveautomation.com/t/ribbon-chart-in-ignition-reporting-module/88209/6 "2024-04-03T15:01:01Z")

</div>

The `configureChart` extension function _gives you_ an instance of `JFreeChart` you have to customize. You don't want to create your own, nor (likely) your own dataset. I don't know where you got that example from (ChatGPT, I'm guessing), but _most_ of the code there isn't suitable for this application.

Try just this code in `configureChart` to verify that the function is actually doing _anything_:

```auto
from org.jfree.chart.renderer.category import LineAndShapeRenderer

renderer = LineAndShapeRenderer()
renderer.setSeriesPaint(0, system.gui.color(255, 0, 0))
char.plot.renderer = renderer

```
