# Jfreechart tag provider

**URL:** <https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928>\
**Category:** General Discussion\
**Created:** [October 8, 2019, 5:10pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928 "2019-10-08T17:10:09Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 5:10pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/1 "2019-10-08T17:10:09Z")

</div>

Hello I have a simple component jfreechart how to insert data from a tag in this graphic  
thanks

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 8, 2019, 5:21pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/2 "2019-10-08T17:21:14Z")

</div>

Is there a reason that you are not using the chart components built in Ignition?

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 6:01pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/3 "2019-10-08T18:01:53Z")

</div>

it’s just a test for a component developed from outside of ignition

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [October 8, 2019, 6:23pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/4 "2019-10-08T18:23:21Z")

</div>

Someone who does a bit more module development might be able to answer in detail, but you will have to create the properties in the component you import and pass the data in through the designer.

I would take a look at the following link for the github for their vision component example.

> **[inductiveautomation/ignition-sdk-examples](https://github.com/inductiveautomation/ignition-sdk-examples/tree/master/vision-component)**
>
> master/vision-component

This page from the SDK documentation also is useful.  
[https://docs.inductiveautomation.com/display/SE/Component+Overview](https://docs.inductiveautomation.com/display/SE/Component+Overview)

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 6:30pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/5 "2019-10-08T18:30:16Z")

</div>

yes I use this example on github when I export the module I try to drag and drop a tag but no data is displayed  
thanks

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [October 8, 2019, 6:32pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/6 "2019-10-08T18:32:59Z")

</div>

Drag and drop probably is something that would need to be configured separately from the properties.

Hopefully someone who’s done more component stuff will see this. I mostly do modules to import libraries for scripting more than components and stuff.

---

<div class="post-metadata">

**Author:** ![ayu](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ayu/32/16635_2.png) [@ayu](https://forum.inductiveautomation.com/u/ayu)\
**Post date:** [October 8, 2019, 7:15pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/7 "2019-10-08T19:15:39Z")

</div>

You would need to add a DnD transfer handler to the component (doesn’t look like the sdk example has one) in order to support it. A good starting point would be to look at this - [https://docs.oracle.com/javase/tutorial/uiswing/dnd/intro.html](https://docs.oracle.com/javase/tutorial/uiswing/dnd/intro.html). I’m not entirely sure what the data flavour of tags look like so perhaps someone could chime in on that.

---

<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:** [October 8, 2019, 7:23pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/8 "2019-10-08T19:23:19Z")

</div>

From the Easy Chart, to support drag and drop you’ll want to accept the ListOfNodeBrowseInfo flavor:

```auto
boolean fromTree = event.isDataFlavorSupported(ListOfNodeBrowseInfo.FLAVOR);
boolean fromTreeHistorical = event.isDataFlavorSupported(ListOfQualifiedPath.FLAVOR);
boolean fromTable = event.isDataFlavorSupported(VisionAdvancedTable.selectedRowsFlavor);

```

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 7:25pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/9 "2019-10-08T19:25:48Z")

</div>

okay okay is there any other way to read a tag in a chart without drag and drop

---

<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:** [October 8, 2019, 7:30pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/10 "2019-10-08T19:30:25Z")

</div>

Properly expose your fields following the Javabeans property-access style. The designer will automatically turn those javabeans into bindable properties in the designer - then you can just configure a binding on them in the runtime.

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 7:45pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/11 "2019-10-08T19:45:40Z")

</div>

I only see the data property in the style field but can not use the tag to display the data

![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/04443aaed1cc3239069b9ef148c4d80c382de2d4.png)

---

<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:** [October 8, 2019, 7:50pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/12 "2019-10-08T19:50:59Z")

</div>

JFreeChart uses a different backing Dataset class (confusingly), not Ignition’s built-in dataset. Expose a generic ‘data’ property (type `ignition.common.Dataset`) with a getter and setter. Then when that property changes (ie, once a binding has been applied) you’ll need to pass that **Ignition** dataset into a new instance of `com.inductiveautomation.factorypmi.application.components.chart.runtime.XYNumericDataSet.XYNumericDataSet`. The DatasetDescriptor constructor argument bridges the gap between Ignition’s Dataset class and JFreeChart’s.

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 8:15pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/13 "2019-10-08T20:15:27Z")

</div>

Ok thanks for the precision do you have a tutorial that explains the unfolding  
.

---

<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:** [October 8, 2019, 8:20pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/14 "2019-10-08T20:20:55Z")

</div>

Nope! 🙂

Charts are a particularly rough starting point to build off of. @pturmel may have some advice, I know he’s at least extended the built in charts in one of his modules.

---

<div class="post-metadata">

**Author:** ![wilfrid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wilfrid/32/11228_2.png) [@wilfrid](https://forum.inductiveautomation.com/u/wilfrid)\
**Post date:** [October 8, 2019, 8:39pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/15 "2019-10-08T20:39:42Z")

</div>

thanks PGriffith @pturmel do you have an example that you suggest

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 8, 2019, 9:37pm UTC](https://forum.inductiveautomation.com/t/jfreechart-tag-provider/28928/16 "2019-10-08T21:37:19Z")

</div>

Unfortunately, no. I didn’t have to manipulate the JFreeChart datasets themselves when I wrote the NoteChart module. The key will be to have the setter for your data property initiate the transformation.
