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

Pie chart doesnt restyle marker.colors #247

Closed
andrey-zakharov opened this issue Feb 10, 2016 · 5 comments
Closed

Pie chart doesnt restyle marker.colors #247

andrey-zakharov opened this issue Feb 10, 2016 · 5 comments

Comments

@andrey-zakharov
Copy link

Simple test case:

var trace1 = {
  labels: [1, 2, 3, 4],
  values: [10, 15, 13, 17],
  type: 'pie',
};

var update = {
    'marker.colors': ['#200', '#400', '#600', '#800']
}

Plotly.newPlot(graphDiv, [trace1], {title: "test pie"});
Plotly.restyle(graphDiv, update);

http://codepen.io/anon/pen/RrEPgy?editors=0010
doesn't update colors.

seems like marker.colors not included somewhere to replot flags.

@andrey-zakharov
Copy link
Author

Also it doesnt work for "pull" and "textposition" attr if they is as arrays.

@etpinard
Copy link
Contributor

You have to wrap all array attributes into another array in the restyle call.

http://codepen.io/etpinard/pen/YwdwjN

@etpinard
Copy link
Contributor

The outer array in restyle maps to different traces.

@etpinard
Copy link
Contributor

This is a recurring issue for a lot of users. We're thinking about throwing errors when the restyle updates aren't formatted properly. You can following our discussion here: #167

@mcin-armintaheri-archive

I'd like to note that the initial marker.colors for colorscale is an empty array. This causes a problem in the workspace2 frontend where empty colorscales are being shifted into a components state. @chriddyp and I think what should happen is the actual colours that appear on the plot should be reflected in marker.colors

http://jsbin.com/gasiruyali/edit?html,js,console,output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants