# Chart Plugins can draw charts with any JavaScript charting library. The TRMNLCharts helper supplies the framework's colors, so a chart adapts to the device and themes like the rest of the screen. ### Usage Any JavaScript library you can load from a CDN can draw charts. The examples below use [Highcharts](https://highcharts.com) and [Chartkick](https://chartkick.com). Use the `TRMNLCharts` helper for your chart colors. It is bundled in the plugin runtime and reads the right paint from the screen as the chart builds, so a chart follows the device and the active theme like the rest of the screen. The methods below are the ones these examples use; [Painting Charts](/framework/docs/3.4/paint_charts) carries the full list. - `series(i, n, { el })`: the fill for series _i_ of _n_, correct for the current device, mode, and theme. - `applySwatches({ el })`: paints legend markers tagged `data-chart-series="i"` with matching series colors. Add `data-chart-series-count="n"` when the series total differs from the number of marks on screen. - `textStyle(role, { el })`: resolves a framework typography role for SVG text. - `options({ el })` and `merge()`: the recommended adaptive Highcharts defaults, merged under your overrides. - `watch(el, buildFn)`: rebuilds the chart when device, scale, mode, dark mode or theme changes. - `paint(token, { el })`: one framework color, as a flat color on solid panels or a dither pattern on 1- and 2-bit screens. - `grid({ el, dir })` and `axisLine({ el })`: the grid-line and axis and tick options that `options()` already applies, for an axis you build by hand. `{ el }` is the chart container id or element. Omit it on a single-screen plugin. `TRMNLCharts` is the Highcharts adapter built on `TRMNLPaint`, the framework's public JS paint API. Grid lines and plotted text use the same border and typography systems as the rest of the screen. For anything beyond Highcharts, use TRMNLPaint directly: see [Paint API](/framework/docs/3.4/paint_api) . On screens that dither, series paints are patterns that Highcharts draws through its pattern-fill module; load `pattern-fill.js` next to `highcharts.js` as the examples do. Maps follow the same pattern: `TRMNLMaps` composes MapLibre GL JS styles from framework paint over OpenStreetMap vector tiles. See [Map](/framework/docs/3.4/map) . Highcharts takes sizes as plain numbers, so they do not follow the device scale on their own. Pass heights, spacing, line widths, and label offsets through `TRMNLPaint.px()` inside `TRMNLCharts.watch()`. The watcher rebuilds the chart after a scale change, and the paint API supplies the new numbers. Set `height: null` in the chart options and the chart expands to fill the available space. Disable animations, or TRMNL's screenshot service may capture the chart only partially drawn. These examples load Highcharts and Chartkick from trmnl.com, so they render empty without network. Highcharts is a commercial library that TRMNL licenses, and a custom stack brings its own charting library and license. #### Line Chart A line chart tracks a value over time. 25,388Pageviews 4,771Visitors 2.23Mins on Page ChartsLine Chart ```