Re: Shapes for bar diagramm

Hi Ugo,

I am not clear about your question about combining
VisADLineArrays since I don't know where your code
will construct them.  However, you could construct

  ScalarMap smap = new ScalarMap(Precipitation, Display.Shape);
  ShapeControl scontrol = smap.getControl();
  scontrol.setShapeSet(new Integer1DSet(1));  // only one value
  VisADLineArray line = new VisADLineArray();
  line.vertexCount = 2;
  line.coordinates = new float[]
    {0.0f,  0.0f, 0.0f,    0.0f, 0.1f, 0.0f}; // short line
  scontrol.setShapes(new VisADGeometryArray[] {line});
  ScalarMap smap2 = new ScalarMap(Precipitation, Display.ShapeScale);
  smap2.setRaneg(0.0, max_precip);

This should make the lines scale by precipitation value -
every precip value maps to the same shape, but the
precip value also maps to the shape scale which will
control their lengths.

You'll also need to map day to XAxis.

Please just experiment with this a bit.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

  • 1999 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: