B4J Question How to set custom color to jchart piechart slices and legend

mcqueccu

Well-Known Member
Licensed User
Longtime User
You can use this to change the pie (slices color). Change the default-color0 up to the number of slices you have

B4X:
    Dim style0 As Map = PieChart.GetChildStyleMap(".default-color0.chart-pie")
    style0.put("-fx-background-color", "#FF0000")
    PieChart.SetChildStyleMap(".default-color0.chart-pie",style0)


For the legend, I will have to check the documentation
 
Upvote 1

Ishmael

Member
You can use this to change the pie (slices color). Change the default-color0 up to the number of slices you have

B4X:
    Dim style0 As Map = PieChart.GetChildStyleMap(".default-color0.chart-pie")
    style0.put("-fx-background-color", "#FF0000")
    PieChart.SetChildStyleMap(".default-color0.chart-pie",style0)


For the legend, I will have to check the documentation
This works, now remaining the legend
 
Upvote 0
Top