Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class VolumeSeries

  1. Object
  2. Series
  3. XYSeries
  4. BarSeries
  5. VolumeSeries

Traded volume per period, each bar coloured by whether its period closed up or down.

Usually shown in its own chart under the prices, linked with Chart.syncWith so both pan and zoom together.

CandlestickSeries prices = new CandlestickSeries("ACME")
        .setOhlc(null, new double[]{10, 11}, new double[]{12, 13}, new double[]{9, 10}, new double[]{11, 12});
double[] volumes = {1200, 1800};
VolumeSeries volume = new VolumeSeries("Volume", prices, volumes);

A volume pane under a price pane

Constructors

public VolumeSeries(String name, CandlestickSeries prices, double[] volume)Creates the series.

Methods

protected int colorAt(ChartContext ctx, int i)The fill colour of bar i; the series colour unless a subclass colours bars by value.

Inherited methods

Constructor details

VolumeSeries

public VolumeSeries(String name, CandlestickSeries prices, double[] volume)
Creates the series.

Parameters

name String
the series name
prices CandlestickSeries
the candles that decide each bar’s colour, or null for the series colour
volume double[]
the volume of each period, parallel to the prices

Method details

colorAt

protected int colorAt(ChartContext ctx, int i)
The fill colour of bar i; the series colour unless a subclass colours bars by value.

Parameters

ctx ChartContext
the paint context
i int
the bar index

Returns

an RGB colour