Skip to main content

Charts

camouflage-charts and camouflage_charts draw charts directly. They take their colors and type from the theme and a preset per skin (Material, Carbon, …), so a chart looks like the rest of your screen, in dark mode too.

Charts in the light theme

// implementation("com.srctool.camouflage:camouflage-charts")
CamoLineChart(
title = "Revenue by quarter",
categories = listOf("Q1", "Q2", "Q3", "Q4"),
series = listOf(
ChartSeries("Subscriptions", listOf(12.0, 15.0, 19.0, 27.0)),
ChartSeries("Services", listOf(6.0, 7.0, null, 9.0)), // null is a gap
),
)

The charts​

ChartFor
CamoLineChartTrends, in line or area form; times on the x axis.
CamoBarChartComparing categories, grouped or stacked.
CamoPieChartParts of a whole, as a pie or a donut.
CamoSparklineA tiny trend inside a row or a card.

See each chart's parameters.

Built for everyone​

  • A chart's title is announced, and a data table can stand in for it (showTable).
  • Loading and empty states are built in.
  • Time axes keep their direction in right-to-left layouts.
  • Hover and keyboard focus show the value of a point.