Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker.init Colors not having effect #138

Closed
gaviei opened this issue Aug 23, 2021 · 2 comments · Fixed by #171
Closed

Marker.init Colors not having effect #138

gaviei opened this issue Aug 23, 2021 · 2 comments · Fixed by #171
Labels
Area: MissingAbstraction Plotly.js functionality that has to be implemented

Comments

@gaviei
Copy link

gaviei commented Aug 23, 2021

The example "Customizing Individual Bar Colors" in https://plotly.com/python/bar-charts/#customizing-individual-bar-colors requires the assignment of multiple colors in a markers, which is available in the init method, but has no effect:

#r "nuget: Plotly.NET, 2.0.0-preview.6"
#r "nuget: Plotly.NET.Interactive, 2.0.0-preview.6"

let featureKeys = ["Feature A"; "Feature B"; "Feature C";
                   "Feature D"; "Feature E"]
let featureValues = [20; 14; 23; 25; 22]

let colors = 
    [1..5]
    |> List.mapi (fun i x -> if i = 1 then "crimson" else "lightslategray" )
    |> List.toSeq

let marker = Marker.init(Colors = colors);
// marker?color<-colors

Chart.Column (featureKeys, featureValues, Marker=marker)

image

in the other hand, the dynamic assignment of color works:
image

@kMutagene kMutagene added the Area: MissingAbstraction Plotly.js functionality that has to be implemented label Aug 24, 2021
@kMutagene
Copy link
Member

@gaviei can you please add the code directly here instead of a screenshot so i can copy paste it to test? also for the other issues

@gaviei gaviei changed the title Marker?Color abstraction missing Marker.init Colors not having effect Aug 24, 2021
@gaviei
Copy link
Author

gaviei commented Aug 24, 2021

@kMutagene Issue comment was updated. Please check and let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: MissingAbstraction Plotly.js functionality that has to be implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants