Title: Pie Chart Fields
Last modified: December 11, 2023

---

# Pie Chart Fields

 *  Resolved [andyro](https://wordpress.org/support/users/andyro/)
 * (@andyro)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/pie-chart-fields/)
 * I’m making a calculator with a pie chart to show how housing affordability is
   largely a function of finance costs and taxes on taxes on taxes. It calls a Pie
   Chart in charts js, the canvas and values display, but I am having trouble adding
   more than two fields (pie chart is at the very bottom of my calculator page).
   The third and fourth fields mess up the chart (it becomes a solid field of one
   colour). Here is how I am adding data, field by field in the field holding custom
   values (all in dollars):
 * (function(){
   setPieChartBlock(‘my_canvas’,[{label: ‘Land Cost’, value: fieldname41},{
   label: ‘Land Cost’, value: fieldname41},{label: ‘Land Appreciation’, value: fieldname56},]);})()
 * But over in Charts.js I see they make a dataset and just call that:
 * const DATA_COUNT = 5;
   const NUMBER_CFG = {count: DATA_COUNT, min: 0, max: 100};
 * const data = {
   labels: [‘Red’, ‘Orange’, ‘Yellow’, ‘Green’, ‘Blue’],datasets:[{
   label: ‘Dataset 1’,data: Utils.numbers(NUMBER_CFG),backgroundColor: Object.values(
   Utils.CHART_COLORS),}]};
 * Can you tell me what I may be misunderstanding? Does the pie calculate its own
   total (ie. 100%) from the fields a user adds, or does that need to be specified
   somewhere for the subsequent data fields to represent pie slices?
 * PS: I’m not sure where the mouseover display values of 10, 10, 4 are coming from,
   they should show the values from their respective fields and dollars before, 
   no?
 * PPS: I show land cost 2x because the pie breaks anytime I add any other field
   with a dollar value sum from the subtotal fields on the right hand side of the
   calculator.
    -  This topic was modified 2 years, 5 months ago by [andyro](https://wordpress.org/support/users/andyro/).
    -  This topic was modified 2 years, 5 months ago by [andyro](https://wordpress.org/support/users/andyro/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpie-chart-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/pie-chart-fields/#post-17268527)
 * Hello [@andyro](https://wordpress.org/support/users/andyro/)
 * The numbers 4, and 10, are the values of fields fieldname41 and fieldname56 on
   your form.
 * The setPieChartBlock is a commercial block of the “CP Blocks” plugin. If you 
   have additional questions about setPieChartBlock, you should contact us directly
   through the “CP Blocks” website:
 * [https://services.dwbooster.com/contact](https://services.dwbooster.com/contact)
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Pie Chart Fields’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [values](https://wordpress.org/support/topic-tag/values/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/pie-chart-fields/#post-17268527)
 * Status: resolved