Package com.codename1.ui.chart
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.
-
ClassDescriptionA reference line, shaded band or label laid over a cartesian chart: a target, a threshold, a weekend, a release date.An interactive, animated chart.Everything a series needs to paint one frame: graphics, the plot rectangle, the axes and how far the current animation has progressed.A data point the user tapped, hovered or selected.Colours a chart is painted with.Maps numbers to colours for heatmaps: a sequence of colour stops interpolated linearly.Notified when the user taps a legend entry, whether or not the tap toggled the series (see
Chart#setLegendToggles(boolean)).Receives the range the user selects by dragging across a chart with brushing on.Notified when the user selects a data point by tapping or clicking it.One data series.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.Customizes the text of the tooltip.A node of hierarchical data for treemaps and sunbursts.Told about every change to the tree under the node it is set on:setValueandaddon that node or any node below it.Turns a data value into the text an axis, tooltip or data label shows.