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

Genarating Pie chart #484

Closed
ghost opened this Issue Aug 7, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@ghost
Copy link

commented Aug 7, 2014

I have Json data like this:
[{"candidate":"Mark D. Obenshain","votes":98963},{"candidate":"Mark R. Herring","votes":157550},{"candidate":"Ken T. Cuccinelli, II","votes":93256},{"candidate":"Robert C. Sarvis","votes":13746},{"candidate":"Terry R. McAuliffe","votes":152049},{"candidate":"E.W. Jackson","votes":91143},{"candidate":"Ralph S. Northam","votes":164236}]

Can i plot the pie chart using C3

@masayuki0812

This comment has been minimized.

Copy link
Member

commented Sep 1, 2014

Hi, I think you need to change like this:

{
  "Mark D. Obenshain": [98963],
  "Mark R. Herring": [157550],
  ...
}

Could you try this? Thanks.

@ghost

This comment has been minimized.

Copy link
Author

commented Sep 1, 2014

I am getting that data from query. I converted that json data in to the json array but while transform to any other chart like line,spline giving problem.

@masayuki0812

This comment has been minimized.

Copy link
Member

commented Sep 20, 2014

Could you show me a fiddle to reproduce your situation?

@HarishkumarTVN

This comment has been minimized.

Copy link

commented Nov 13, 2014

Hi, I have similar issue, i have data as follows.

[{"LC":"xyz","count":1000},{"LC":"abc","count":2000},{"LC":"BCD","count":1500},{"LC":"Others","count":500}]';

Is it possible to generate pie chart ? i am able to generate line & bar but when using the chart type as pie. It is just showing 100 %.

Regards
Harish

@masayuki0812

This comment has been minimized.

Copy link
Member

commented Nov 13, 2014

Hi, you need to use different data name if you want to show them as different pie pieces. In this case, there is only one data named count, so pie chart shows only one piece, line & bar chart shows them as categorized though.

@agdev

This comment has been minimized.

Copy link

commented Jan 30, 2015

Hi,
I have similar need, json data with two columns datalabel and value.
I think pie chart should work as other charts and not to be exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.