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

Donut 0 value when compared to lines and bar #13

Closed
techgasp opened this issue Jul 14, 2019 · 5 comments
Closed

Donut 0 value when compared to lines and bar #13

techgasp opened this issue Jul 14, 2019 · 5 comments

Comments

@techgasp
Copy link

Hi there,
Great job with fork, I'm using it on a project to display graph data.
I've seen people complaining about this in several places "impossible to display donut graph with 0 data values (just displays empty space as you know)
But it's weird the same data... with 0 values is displayed in both lines and bars graphs, these graphs get generated with 0 vales... awesome.
It would be great if donut graphs worked the same way, the graph would be generated qith 0 vales.
donut.png

@pierresh
Copy link
Owner

Hello,

thanks for your message, so far it works well if at least one value is not equal to 0. But actually, I am not really what should be shown if every value is equal to 0. Probably better to display a message ("No data for this chart") like when the data array is empty

Morris.Donut({
	element: 'chart_donut',
	data: [
		{label: 'Label 1', value: 1 },
		{label: 'Label 2', value: 0 }
	],
	donutType: 'pie',
	dataLabels: true,
	dataLabelsPosition: 'outside'
});

image

@techgasp
Copy link
Author

techgasp commented Jul 14, 2019

"I am not really what should be shown if every value is equal to 0"
Design wise it sucks not to have the graph. If all values = 0 maybe it should generate a graph with just 1 slice with value 0... Almost like your screenshot without the green. Or more complex all slices the same size with value 0.

It think people complain about this not because of values, the graph is correct... it's just because of design and display like my screenshot.

@pierresh
Copy link
Owner

Hello,

I just published a quick commit in order to display segments of pie charts even if the total value is equal to 0. This works for both pie and donut charts.

image

@techgasp
Copy link
Author

You are awesome.
Screenshot.png

@pierresh
Copy link
Owner

If you like this plugin, please star it :)

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

2 participants