# BasicStroke assitance

**URL:** <https://forum.inductiveautomation.com/t/basicstroke-assitance/18486>\
**Category:** Ignition\
**Created:** [June 15, 2018, 6:50pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486 "2018-06-15T18:50:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [June 15, 2018, 6:50pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/1 "2018-06-15T18:50:15Z")

</div>

Still trying to learn…  
I have read and re-read the Class java.awt.BasicStroke information and am still not getting it…

```
    from org.jfree.chart.plot import ValueMarker
from java.awt import BasicStroke
marker=ValueMarker(850,system.gui.color(217,0,0),BasicStroke(3))
chart.getPlot().addRangeMarker(marker)

```

This code works, I am trying make the line dashed…not really understanding I tried BasicStroke(3,1,1,1,1,1) to maybe use the defaults?!? It is getting hung up trying to coerce the 5th arg (the dash array?!?) into a float…can someone give me an example of what it wants for the float array for the dashes? This is the part I dont understand…I tried importing and using getFloatArray() but it didnt like that either…

Thanks in advance

---

<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:** [June 15, 2018, 7:30pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/2 "2018-06-15T19:30:54Z")

</div>

Something like this:

```auto
import jarray
from java.awt import BasicStroke

dashes = jarray.array([6, 2], 'f')
s = BasicStroke(3.0, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0, dashes, 0.0)

```

---

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [June 15, 2018, 7:35pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/3 "2018-06-15T19:35:05Z")

</div>

Thank You! This is just what I needed!

---

<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:** [June 15, 2018, 7:37pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/4 "2018-06-15T19:37:43Z")

</div>

You can even skip the `jarray` import - Jython will automagically turn your python list into a relevant Java type:

```auto
	s = BasicStroke(
		3.0, #width
		BasicStroke.CAP_ROUND, #cap 
		BasicStroke.JOIN_ROUND, #join
		1.0, #miterLimit
		[2, 4, 8, 16, 32], #dash pattern
		0.0) #dash_phase_offset
	
	m = ValueMarker(75, system.gui.color(200, 0, 0), s)
	chart.getPlot().addRangeMarker(m)

```

---

<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:** [June 15, 2018, 7:39pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/5 "2018-06-15T19:39:17Z")

</div>

> [@paul-griffith](#):
>
> automagically

Usually. /-: I forget the traps, so I tend be pedantic.

---

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [June 15, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/6 "2018-06-15T19:47:14Z")

</div>

Thank you both…this helps immensely because I jumped into Igniton from my PLC, VB and C background with limited knowledge of JAVA…not ideal but it is where I am!

---

<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:** [June 15, 2018, 7:48pm UTC](https://forum.inductiveautomation.com/t/basicstroke-assitance/18486/7 "2018-06-15T19:48:58Z")

</div>

> [@leversole](#):
>
> from my PLC, VB and C background

That is a relatively rare and valuable combination. I suspect Java and Jython will come easily.
