Class | Description |
---|---|
ChartComponent |
The top level component for displaying charts
|
ChartUtil |
A utility class for painting a chart onto a Graphics context.
|
The charts
package enables Codename One developers to add charts and
visualizations to their apps without having to include external libraries or embedding web views.
We also wanted to harness the new features in the graphics pipeline to maximize performance.
Since the charts package makes use of 2D transformations and shapes, it requires some of the graphics features that are not yet available on all platforms. Currently the following platforms are supported:
com.codename1.charts,ChartComponent
class includes optional pinch zoom support.com.codename1.charts,ChartComponent
class includes optional support for panning.
The com.codename1.charts
package includes models and renderers for many
different types of charts. It is also extensible so that you can add your own chart types if required.
The following screen shots demonstrate a small sampling of the types of charts that can be
created.
The above screenshots were taken from the ChartsDemo app. Y ou can start playing with this app by checking it out from our git repository. |
Adding a chart to your app involves four steps:
com.codename1.charts.models
package. Essentially, this
is just where you add the data that you want to display.com.codename1.charts.renderers
package. The renderer
allows you to specify how the chart should look. E.g. the colors, fonts, styles, to use.
com.codename1.charts.views
package.
com.codename1.charts,ChartComponent
. In order to add your
chart to the UI, you need to wrap it in a com.codename1.charts,ChartComponent
object.You can check out the ChartsDemo app for specific examples, but here is a high level view of some code that creates a Pie Chart.
The charts package is derived work from the excellent open source aChartEngine API.
Copyright © 2023. All rights reserved.