@@ -1180,7 +1180,10 @@ pub struct Marker {
1180
1180
size_mode : Option < SizeMode > ,
1181
1181
line : Option < Line > ,
1182
1182
gradient : Option < Gradient > ,
1183
+ /// Marker option specific for Scatter and other common traces
1183
1184
color : Option < Dim < Box < dyn Color > > > ,
1185
+ /// Marker option specific for Pie charts to set the colors of the sectors
1186
+ colors : Option < Vec < Box < dyn Color > > > ,
1184
1187
cauto : Option < bool > ,
1185
1188
cmin : Option < f64 > ,
1186
1189
cmax : Option < f64 > ,
@@ -1260,6 +1263,11 @@ impl Marker {
1260
1263
self
1261
1264
}
1262
1265
1266
+ pub fn colors < C : Color > ( mut self , colors : Vec < C > ) -> Self {
1267
+ self . colors = Some ( ColorArray ( colors) . into ( ) ) ;
1268
+ self
1269
+ }
1270
+
1263
1271
pub fn color_array < C : Color > ( mut self , colors : Vec < C > ) -> Self {
1264
1272
self . color = Some ( Dim :: Vector ( ColorArray ( colors) . into ( ) ) ) ;
1265
1273
self
@@ -2330,6 +2338,7 @@ mod tests {
2330
2338
. line ( Line :: new ( ) )
2331
2339
. gradient ( Gradient :: new ( GradientType :: Radial , "#FFFFFF" ) )
2332
2340
. color ( NamedColor :: Blue )
2341
+ . colors ( vec ! [ NamedColor :: Black , NamedColor :: Blue ] )
2333
2342
. color_array ( vec ! [ NamedColor :: Black , NamedColor :: Blue ] )
2334
2343
. cauto ( true )
2335
2344
. cmin ( 0.0 )
@@ -2359,6 +2368,7 @@ mod tests {
2359
2368
"line" : { } ,
2360
2369
"gradient" : { "type" : "radial" , "color" : "#FFFFFF" } ,
2361
2370
"color" : [ "black" , "blue" ] ,
2371
+ "colors" : [ "black" , "blue" ] ,
2362
2372
"colorbar" : { } ,
2363
2373
"cauto" : true ,
2364
2374
"cmin" : 0.0 ,
0 commit comments