# Can't set pen attributes for Easy Chart template

**URL:** <https://forum.inductiveautomation.com/t/cant-set-pen-attributes-for-easy-chart-template/17063>\
**Category:** Ignition\
**Created:** [February 20, 2018, 10:21pm UTC](https://forum.inductiveautomation.com/t/cant-set-pen-attributes-for-easy-chart-template/17063 "2018-02-20T22:21:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dberry](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@dberry](https://forum.inductiveautomation.com/u/dberry)\
**Post date:** [February 20, 2018, 10:21pm UTC](https://forum.inductiveautomation.com/t/cant-set-pen-attributes-for-easy-chart-template/17063/1 "2018-02-20T22:21:16Z")

</div>

I created a script (see excerpt below) to dynamically add pens to an Easy Chart object but I can’t seem to set some of the pen attributes when the Easy Chart is a component within a template instance. If I place the script inside the extension function ‘onTagsDropped’, when the Easy Chart component is placed on a window (no template) the pens are added as expected with attributes correctly set. However, when the chart is a component of a template instance on a window, not all the attributes get set correctly. In particular, the ‘color’ and ‘userRemovable’ attributes seem to be overwritten from what I set in the script.

Any suggestions?

Thanks  
Dan

```
    aggregation = 'Average'
axis = 'Default Axis'
subplot = '1'
enabled = 'True'
color = penColor
dashPattern = ''
renderStyle = '1'
lineWeight = '1'
shape = '0'
fillShape = 'True'
labels = 'False'
groupName = ''
digital = 'False'
overrideAutocolor = 'True'
hidden = 'False'
userSelect = 'True'
sortOrder = ''
userRemovable = 'True'

newRow = [penName, tagPath, aggregation, axis, subplot, enabled, color, dashPattern, renderStyle, lineWeight, \
shape, fillShape, labels, groupName, digital, overrideAutocolor, hidden, userSelect, sortOrder, userRemovable]

#add pen
self.tagPens = system.dataset.addRow(self.tagPens, newRow)
```

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [February 22, 2018, 2:37pm UTC](https://forum.inductiveautomation.com/t/cant-set-pen-attributes-for-easy-chart-template/17063/2 "2018-02-22T14:37:32Z")

</div>

I’m not able to replicate your issue. Can you give some more details?

I copied most of your script (only changing the definitions you didn’t include like ‘penName’) into an Easy Chart within a template instance. I can drag-and-drop tags from a historical Tag Browse Tree without issue, both with the tag tree inside the template too, and with it outside the template in the parent window.
