Jump to content
Software FX Community

Unable to generate dashed lines


User (Legacy)

Recommended Posts

I have tried the example code from the docs to generate a graph with a

dashed line but it doesm't seem to work. I have copied it here verbatim from

the manual:

<%@page import="SoftwareFX.ChartFX.*"%>

<%

ChartServer chart1 = new ChartServer(application,request,response );

chart1.setGallery(Gallery.LINES);

chart1.setMarkerShape(MarkerShape.NONE);

chart1.setLineWidth((short) 3);

//Populating the chart1

chart1.openData(COD.VALUES, 2, 15);

for (int j = 0;j<15;j++)

{

chart1.setValue(0, j, (java.lang.Math.random() * 60));

chart1.setValue(1, j, ((java.lang.Math.random() * 80) + 50));

}

chart1.closeData(COD.VALUES);

chart1.getSeries(0).setLineStyle(java.awt.BasicStroke.JOIN_MITER);

//chart1.getSeries(1).setLineStyle(new

java.lang.Drawing.Drawing2D.DashStyle.Dash);

%>

<%=chart1.getHtmlTag("450","280")%>

--

Colin McFarlane

Director

http://www.incito.com

Inspired Business Solutions

Tel: +44 (0) 131 556 4300

Mob: +44 (0) 795 070 9875

Link to comment
Share on other sites

Hi, the sample is wrong, we have produced an updated sample but somehow it 

has not been in updated in the documentation.

The correct way to setup a line style is

chart1.getSeries(0).setLineStyle(LineStyle.DASH);

The available options are:

LineStyle.DASH

LineStyle.DASH_DOT

LineStyle.DASH_DOT_DOT

LineStyle.DOT

LineStyle.SOLID

GA

Software FX, Inc.

"colin-mcfarlane" <colin-mcfarlane@supanet.com> wrote in message

news:W9oXGD3rEHA.3136@webserver3.softwarefx.com...

>I have tried the example code from the docs to generate a graph with a

> dashed line but it doesm't seem to work. I have copied it here verbatim

> from

> the manual:

>

> <%@page import="SoftwareFX.ChartFX.*"%>

> <%

>

> ChartServer chart1 = new ChartServer(application,request,response );

> chart1.setGallery(Gallery.LINES);

> chart1.setMarkerShape(MarkerShape.NONE);

> chart1.setLineWidth((short) 3);

>

> //Populating the chart1

> chart1.openData(COD.VALUES, 2, 15);

> for (int j = 0;j<15;j++)

> {

> chart1.setValue(0, j, (java.lang.Math.random() * 60));

> chart1.setValue(1, j, ((java.lang.Math.random() * 80) + 50));

> }

> chart1.closeData(COD.VALUES);

>

> chart1.getSeries(0).setLineStyle(java.awt.BasicStroke.JOIN_MITER);

> //chart1.getSeries(1).setLineStyle(new

> java.lang.Drawing.Drawing2D.DashStyle.Dash);

>

> %>

>

> <%=chart1.getHtmlTag("450","280")%>

>

>

> --

> Colin McFarlane

> Director

> http://www.incito.com

> Inspired Business Solutions

> Tel: +44 (0) 131 556 4300

> Mob: +44 (0) 795 070 9875

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...