Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

how to set style of line
 Post subject: how to set style of line Post rating: 0   New post Posted: Sat 21 Aug, 2010, 11:46 

User rating: 0
Joined: Fri 20 Aug, 2010, 14:09
Posts: 20
I want to set the style of a line to dashed. Any one knows how to do that? I tried to use setAttrInt but was not successful .Setting the color works fine though:


IChartObject line = chart.draw("priceline", IChart.Type.PRICEMARKER, cal.getTimeInMillis(), 1.2700);
line.setColor(new Color(0,255,0));

any help is appreciated.


 
 Post subject: Re: how to set style of line Post rating: 0   New post Posted: Wed 25 Aug, 2010, 08:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
please consider this code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
        line.setStroke(new BasicStroke(
                1,
                BasicStroke.CAP_BUTT,
                BasicStroke.JOIN_BEVEL,
                0,
                new float[] {5},//dashed line
                0));
 
Parsed in 0.027 seconds, using GeSHi 1.0.8.4


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com