Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
package com.codename1.ui.chart
Modern, interactive and animated charts.
Chart is the component; series (com.codename1.ui.chart.series) hold data and paint
themselves, axes (com.codename1.ui.chart.axis) map values to the plot. Labels are laid out
so they never overlap, and pan, zoom, tooltips and legend toggles work with touch, mouse,
trackpad and keyboard.
Form form = new Form("Revenue", new BorderLayout());
Chart chart = new Chart().setTitle("Revenue")
.setXAxis(new CategoryAxis(Axis.BOTTOM, "Q1", "Q2", "Q3", "Q4"));
chart.addSeries(new BarSeries("Sales").setData(null, new double[]{120, 180, 150, 210}));
form.add(BorderLayout.CENTER, chart);Every change to the data animates, and several series can share a chart. Chart.syncWith
links charts so a price pane and its volume pane pan and zoom together. Sparkline is a
small trend for list rows. For readers who cannot see the picture, a chart describes itself
to screen readers and Chart.toTable returns the same data as a table.
This package replaces the deprecated com.codename1.charts.
Types
class Annotation | A reference line, shaded band or label laid over a cartesian chart: a target, a threshold, a weekend, a release date. |
class Chart | An interactive, animated chart. |
class ChartContext | Everything a series needs to paint one frame: graphics, the plot rectangle, the axes and how far the current animation has progressed. |
class ChartPoint | A data point the user tapped, hovered or selected. |
class ChartTheme | Colours a chart is painted with. |
class ColorScale | Maps numbers to colours for heatmaps: a sequence of colour stops interpolated linearly. |
interface LegendListener | Notified when the user taps a legend entry, whether or not the tap toggled the series (see Chart#setLegendToggles(boolean)). |
interface RangeListener | Receives the range the user selects by dragging across a chart with brushing on. |
interface SelectionListener | Notified when the user selects a data point by tapping or clicking it. |
class Series | One data series. |
class Sparkline | A word sized chart for list rows, table cells and dashboards: a line, area or bar trend with no axes, legend or interaction, cheap enough to have hundreds on screen. |
interface TooltipRenderer | Customizes the text of the tooltip. |
class TreeNode | A node of hierarchical data for treemaps and sunbursts. |
interface ValueFormatter | Turns a data value into the text an axis, tooltip or data label shows. |