Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
overpas authored May 30, 2024
1 parent 379f030 commit ad2b366
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,14 @@ private val simpleTreeData = tree(10) {
node(1)
}

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ComposetreemapchartTheme {
Surface(color = MaterialTheme.colors.background) {
TreemapChart(
data = simpleTreeData,
evaluateItem = { it.toDouble() },
treemapChartMeasurer = remember { SquarifiedMeasurer() },
modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(),
) { item ->
SimpleTreemapItem(item = item.toString())
}
}
}
}
@Composable
fun MyChart() {
TreemapChart(
data = simpleTreeData,
evaluateItem = Int::toDouble,
modifier = Modifier.fillMaxSize(),
) { item ->
SimpleTreemapItem(item = item.toString())
}
}
```
Expand Down

0 comments on commit ad2b366

Please sign in to comment.