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

Drawing order for mixed chart is not behaving as documented. #6888

Closed
ck-gith opened this issue Jan 2, 2020 · 2 comments · Fixed by #6897
Closed

Drawing order for mixed chart is not behaving as documented. #6888

ck-gith opened this issue Jan 2, 2020 · 2 comments · Fixed by #6897

Comments

@ck-gith
Copy link

ck-gith commented Jan 2, 2020

Why is it named drawing order when the legend order are also reordered when I use order property? (which is the same as changing the order for the dataset array)

Expected Behavior

https://www.chartjs.org/docs/latest/charts/mixed.html#drawing-order
when i have 2 dataset with order =1 and order =2 , order 1 should be drawn below and order=2 should be on top

Current Behavior

order 1 is on top while order 2 is below.

Steps to Reproduce (for bugs)

https://codepen.io/kurkle/pen/povdejq?editors=1010

Context

Environment

  • Chart.js version: master
@kurkle
Copy link
Member

kurkle commented Jan 2, 2020

The codepen link is to a template with only one dataset, please provide a test case showing the issue.

@ck-gith
Copy link
Author

ck-gith commented Jan 3, 2020

var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { type: 'line', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes 1', data: [12, 19, 3, 5, 2, 3], order:2, color:'#f8cb00' }, { label: '# of Votes 2', data: [1, 2, 3, 4, 5, 6], order:1, type:'bar' }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero:true } }] } } });

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

Successfully merging a pull request may close this issue.

3 participants