@Preview
@Composable
private fun BarChartPreview () {
BarChart (
RandomData (DefaultData .SIMPLE_SERIES , 3 ),
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .medium
)
@Preview
@Composable
private fun BarChartHorizontalPreview () {
BarChart (
RandomData (DefaultData .SIMPLE_SERIES , 3 ),
modifier = Modifier
.fillMaxWidth()
.height(300 .dp),
isVertical = false ,
margins = Margins .wide,
legendPosition = Charts .LEGEND_RIGHT
)
}
@Preview
@Composable
private fun PieChartPreview () {
PieChart (
RandomData (DefaultData .SIMPLE_SERIES , 1 ),
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wide,
legendPosition = Charts .LEGEND_RIGHT
)
}
@Preview
@Composable
private fun LineGraphPreview () {
LineGraph (
RandomData (DefaultData .SIMPLE_SERIES , 1 ),
fillArea = true ,
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wideRight
)
}
@Preview
@Composable
private fun LineGraphMultiPreview () {
LineGraph (
RandomData (DefaultData .SIMPLE_SERIES , 2 ),
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wideRight
)
}
@Preview
@Composable
private fun ScatterGraphPreview () {
LineGraph (
RandomData (DefaultData .SIMPLE_SERIES , 7 ),
drawLine = false ,
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wideRight
)
}
@Preview
@Composable
private fun StockChartPreview () {
StockChart (
RandomData (DefaultData .HLOC_SERIES , 2 ),
modifier = Modifier
.fillMaxWidth()
.height(300 .dp),
margins = Margins (10f , 10f , 30f , 10f )
)
}
Vertical Stacked Bar Chart
@Preview
@Composable
private fun BarChartPreview () {
StackedBarChart (
RandomData (DefaultData .SIMPLE_SERIES , 3 ),
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .medium
)
}
Vertical Stacked 100% Bar Chart
@Preview
@Composable
private fun BarChart100PercentPreview () {
StackedBarChart (
RandomData (DefaultData .SIMPLE_SERIES , 3 ),
is100Percent = true ,
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .medium
)
}
Horizontal Stacked Bar Chart
@Preview
@Composable
private fun BarChartHorizontalPreview () {
StackedBarChart (
RandomData (DefaultData .SIMPLE_SERIES , 3 ),
modifier = Modifier
.fillMaxWidth()
.height(300 .dp),
isVertical = false ,
margins = Margins .wide
)
}
@Preview
@Composable
private fun StackedAreaGraphPreview () {
StackedAreaGraph (
RandomData (DefaultData .SIMPLE_SERIES , 5 ),
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wideRight
)
}
@Preview
@Composable
private fun Stacked100PercentAreaGraphPreview () {
StackedAreaGraph (
RandomData (DefaultData .SIMPLE_SERIES , 5 ), is100Percent = true ,
modifier = Modifier
.fillMaxWidth()
.height(200 .dp),
margins = Margins .wideRight
)
}