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

Show absolute data (no percent values) on donut charts #188

Closed
gopeter opened this issue Apr 28, 2014 · 6 comments
Closed

Show absolute data (no percent values) on donut charts #188

gopeter opened this issue Apr 28, 2014 · 6 comments

Comments

@gopeter
Copy link
Contributor

gopeter commented Apr 28, 2014

It would be great, if there were a possibility to show the absolute values and not the calculated percentages on donut charts. I would really appreciate it! :)

@gopeter gopeter closed this as completed Apr 28, 2014
@lalo
Copy link

lalo commented Sep 11, 2014

Why was this request closed?

@gopeter
Copy link
Contributor Author

gopeter commented Sep 11, 2014

Because you can change it like this:

var chart = c3.generate({
  bindto: '#chart',
  data: {
    columns: chartData,
    type : 'donut'
  },
  color: {
    pattern: ['#AACCB1', '#D4D6D9']
  },
  donut: {
    label: {
      format: function (value) { return value; }
    }
  }
});

@masayuki0812
Copy link
Member

👍

@lalo
Copy link

lalo commented Sep 23, 2014

Thanks

@farizazmi
Copy link

Thanks @gopeter , saved my days! That answer should be on documentation! :)

@nikithaperuka89
Copy link

@gopeter Can you please advice I get the below error when I try to display absolute values and not the calculated percentages on donut charts:

Argument of type '{ bindto: string; size: { height: number; width: number; }; color: { pattern: string[...' is not assignable to parameter of type 'ChartConfiguration'.
Types of property 'donut' are incompatible.
Type '{ label: { format: (value: number) => number; }; }' is not assignable to type '{ label?: { show?: boolean; format?(value: number, ratio: number, id: string): string; threshold?...'.
Types of property 'label' are incompatible.
Type '{ format: (value: number) => number; }' is not assignable to type '{ show?: boolean; format?(value: number, ratio: number, id: string): string; threshold?: number; }'.
Types of property 'format' are incompatible.
Type '(value: number) => number' is not assignable to type '(value: number, ratio: number, id: string) => string'.
Type 'number' is not assignable to type 'string'.

Error: Types of property 'format' are incompatible.
Type '(value: number) => number' is not assignable to type '(value: number, ratio: number, id: string) => string'.
Type 'number' is not assignable to type 'string'.

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

5 participants