ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Custom Symbol Not Displaying w addScatterLayer
Posted by Thom on May-29-2012 01:02
I attempting use a custom symbol with addScatterLayer and have followed previous post
examples but the symbol does not display. The line displays correctly just not the custom
symbol.

c.addScatterLayer(null, new ArrayMath(data7).selectEQZ(new
ArrayMath(pointType).sub(1).
result(),Chart.NoValue).result(),"BC (R) w
Masking").getDataSet(0).setDataSymbol2("lessthanred.png");

If I use a standard symbol it works fine with the appropriate syntax.

Thank you,

Thom

  Re: Custom Symbol Not Displaying w addScatterLayer
Posted by Peter Kwan on May-29-2012 01:37
Hi Thom,

Is it possible the path "lessthanred.png" is not correct?

If you just use "lessthanred.png", ChartDirector will just pass it to Java, and Java will load it from some unknown directory. It may be the "current working directory" (which can be the same directory of your JSP, or the same directory of the Java executable or some other directory), or some directory in the Java class path.

For a JSP application, may be you can add the following code:

//Set search path to current JSP directory for loading icon images
c.setSearchPath(getServletConfig().getServletContext(), request);

With the above code, ChartDirector will try to search the "current JSP directory" first for the file.

Regards
Peter Kwan

  Re: Custom Symbol Not Displaying w addScatterLayer
Posted by Thom on May-29-2012 02:39
Peter,

That was it and thank you very much.

I didn't think I would have to use it when the following code found the image within my JSP
directory without having to add your recommendation.

layer.addDataSet(data1, 0x40cf40, "Computers").setDataSymbol2("small_computer.png");

I'm curious as to the differences.

Thom