{"id":196,"date":"2026-09-28T10:40:59","date_gmt":"2026-09-28T10:40:59","guid":{"rendered":"https:\/\/www.exo-bit.hr\/?p=196"},"modified":"2026-09-28T12:07:41","modified_gmt":"2026-09-28T12:07:41","slug":"personal-doughnut","status":"publish","type":"post","link":"https:\/\/www.exo-bit.hr\/index.php\/2026\/09\/28\/personal-doughnut\/","title":{"rendered":"Personal doughnut"},"content":{"rendered":"\n<!-- Doughnut Assessment Plugin Wrapper -->\n<div class=\"doughnut-assessment-wrapper\">\n  \n  <!-- Form Section -->\n  <div id=\"assessment-form\" class=\"doughnut-card\">\n    <h2 class=\"doughnut-title\">My Personal Doughnut Self-Assessment<\/h2>\n    <div id=\"questions-container\"><\/div>\n    <div id=\"error-message\">Please select an option for all 9 categories before generating the graph.<\/div>\n    <div class=\"btn-container\">\n\n      <button id=\"btn-generate\" type=\"button\">Generate Personal Doughnut<\/button>\n    <\/div>\n  <\/div>\n\n  <!-- Results Section -->\n  <div id=\"results-section\" class=\"doughnut-card\">\n    <div class=\"controls\">\n      <button id=\"btn-toggle-view\" type=\"button\">Unroll Doughnut (Switch to Bar Graph)<\/button>\n      <button id=\"btn-reset\" type=\"button\">Reset Assessment<\/button>\n    <\/div>\n    <div class=\"chart-container\">\n      <canvas id=\"doughnutChart\"><\/canvas>\n    <\/div>\n  <\/div>\n\n<\/div>\n\n<!-- Include CDNs -->\n<script src=\"https:\/\/code.jquery.com\/jquery-3.6.0.min.js\"><\/script>\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n\n<style>\n  .doughnut-assessment-wrapper {\n    --bg-color: #f4f7f6;\n    --card-bg: #ffffff;\n    --text-color: #333333;\n    --primary-color: #2e7d32;\n    --secondary-color: #1565c0;\n    --border-color: #dddddd;\n    \n    font-family: Arial, sans-serif;\n    color: var(--text-color);\n    width: 100%;\n    margin: 20px 0;\n    box-sizing: border-box;\n  }\n\n  .doughnut-assessment-wrapper * {\n    box-sizing: border-box;\n  }\n\n  .doughnut-card {\n    background: var(--card-bg);\n    border: 1px solid var(--border-color);\n    border-radius: 8px;\n    padding: 20px;\n    margin: 0 auto;\n    max-width: 900px;\n  }\n\n  .doughnut-title {\n    text-align: center;\n    margin-top: 0;\n    margin-bottom: 20px;\n    font-size: 24px;\n  }\n\n  .doughnut-assessment-wrapper .form-group {\n    margin-bottom: 15px;\n    padding: 12px;\n    border: 1px solid var(--border-color);\n    border-radius: 6px;\n    background-color: #fafafa;\n  }\n\n  .doughnut-assessment-wrapper label {\n    display: block;\n    font-weight: bold;\n    margin-bottom: 6px;\n  }\n\n  .doughnut-assessment-wrapper select {\n    width: 100%;\n    padding: 8px;\n    border-radius: 4px;\n    border: 1px solid var(--border-color);\n    font-size: 14px;\n    background-color: #fff;\n  }\n\n  .doughnut-assessment-wrapper .btn-container,\n  .doughnut-assessment-wrapper .controls {\n    text-align: center;\n    margin-top: 20px;\n    display: flex;\n    justify-content: center;\n    gap: 15px;\n    flex-wrap: wrap;\n  }\n\n  .doughnut-assessment-wrapper button {\n    padding: 10px 20px;\n    font-size: 15px;\n    font-weight: bold;\n    color: #fff;\n    background-color: var(--primary-color);\n    border: none;\n    border-radius: 4px;\n    cursor: pointer;\n    transition: background-color 0.2s;\n  }\n\n  .doughnut-assessment-wrapper button:hover {\n    background-color: #1b5e20;\n  }\n\n  .doughnut-assessment-wrapper button.btn-test {\n    background-color: var(--secondary-color);\n  }\n\n  .doughnut-assessment-wrapper button.btn-test:hover {\n    background-color: #0d47a1;\n  }\n\n  #results-section {\n    display: none;\n    flex-direction: column;\n  }\n\n  .doughnut-assessment-wrapper .chart-container {\n    position: relative;\n    width: 100%;\n    min-height: 500px;\n    max-height: 650px;\n    margin-top: 20px;\n  }\n\n  #doughnutChart {\n    width: 100% !important;\n    height: 100% !important;\n  }\n\n  #error-message {\n    color: #d32f2f;\n    text-align: center;\n    font-weight: bold;\n    margin-top: 10px;\n    display: none;\n  }\n<\/style>\n\n<script>\n(function($) {\n  const polarCustomRenderPlugin = {\n    id: 'polarCustomRender',\n    afterDatasetsDraw(chart) {\n      if (chart.config.type !== 'polarArea') return;\n      \n      const { ctx, data } = chart;\n      const scale = chart.scales.r;\n      if (!scale) return;\n\n      const centerX = scale.xCenter;\n      const centerY = scale.yCenter;\n      const ticks = scale.getTicks();\n      const outerRadius = scale.drawingArea;\n\n      \/\/ 1. Draw Black Grid Lines\n      ctx.save();\n      ctx.strokeStyle = '#000000';\n      ctx.lineWidth = 1.5;\n\n      ticks.forEach(tick => {\n        const radius = scale.getDistanceFromCenterForValue(tick.value);\n        if (radius > 0) {\n          ctx.beginPath();\n          ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);\n          ctx.stroke();\n        }\n      });\n\n      \/\/ 2. Draw Arc-Curved Labels Along the Circle Radius\n      const labels = data.labels || [];\n      const meta = chart.getDatasetMeta(0);\n      const labelRadius = outerRadius + 15;\n\n      ctx.font = 'bold 12px Arial';\n      ctx.fillStyle = '#000000';\n      ctx.textAlign = 'center';\n      ctx.textBaseline = 'middle';\n\n      meta.data.forEach((element, index) => {\n        const midAngle = (element.startAngle + element.endAngle) \/ 2;\n        const labelText = (labels[index] || '').toUpperCase();\n        \n        const charCount = labelText.length;\n        const totalTextWidth = ctx.measureText(labelText).width;\n        const angularWidth = totalTextWidth \/ labelRadius;\n\n        const normalizedAngle = Math.atan2(Math.sin(midAngle), Math.cos(midAngle));\n        const isBottomHalf = normalizedAngle > 0 && normalizedAngle < Math.PI;\n\n        if (isBottomHalf) {\n          let currentAngle = midAngle + (angularWidth \/ 2);\n\n          for (let i = 0; i < charCount; i++) {\n            const char = labelText[i];\n            const charWidth = ctx.measureText(char).width;\n            const charAngularWidth = charWidth \/ labelRadius;\n\n            const charAngle = currentAngle - (charAngularWidth \/ 2);\n\n            const x = centerX + Math.cos(charAngle) * labelRadius;\n            const y = centerY + Math.sin(charAngle) * labelRadius;\n\n            ctx.save();\n            ctx.translate(x, y);\n            ctx.rotate(charAngle + Math.PI \/ 2 + Math.PI);\n            ctx.fillText(char, 0, 0);\n            ctx.restore();\n\n            currentAngle -= charAngularWidth;\n          }\n        } else {\n          let currentAngle = midAngle - (angularWidth \/ 2);\n\n          for (let i = 0; i < charCount; i++) {\n            const char = labelText[i];\n            const charWidth = ctx.measureText(char).width;\n            const charAngularWidth = charWidth \/ labelRadius;\n\n            const charAngle = currentAngle + (charAngularWidth \/ 2);\n\n            const x = centerX + Math.cos(charAngle) * labelRadius;\n            const y = centerY + Math.sin(charAngle) * labelRadius;\n\n            ctx.save();\n            ctx.translate(x, y);\n            ctx.rotate(charAngle + Math.PI \/ 2);\n            ctx.fillText(char, 0, 0);\n            ctx.restore();\n\n            currentAngle += charAngularWidth;\n          }\n        }\n      });\n\n      ctx.restore();\n    }\n  };\n\n  if (typeof Chart !== 'undefined') {\n    Chart.register(polarCustomRenderPlugin);\n  }\n\n  const categoriesData = [\n    {\n      id: \"income\",\n      label: \"Income\",\n      outreach: 1,\n      options: [\n        { label: \"Unskilled\", value: -3 },\n        { label: \"Unemployed\", value: -2 },\n        { label: \"Low income\", value: -1 },\n        { label: \"Meaningful work\", value: 0 },\n        { label: \"good\/average income\", value: 1 },\n        { label: \"Supported, satisfied\", value: 2 },\n        { label: \"Unsatisfying well paid occupation\", value: 3 },\n        { label: \"Occupation contributes to climate change\", value: 4 },\n        { label: \"High income, high stresss\", value: 5 },\n        { label: \"Non productive occupation\", value: 6 },\n        { label: \"Well paid, destructive occupationr\", value: 7 },\n        { label: \"Excessive income, high stress, burnout\", value: 8 }\n      ]\n    },\n    {\n      id: \"sustenance\",\n      label: \"Sustenance\",\n      outreach: 1,\n      options: [\n        { label: \"Hungry, severely food insecure\", value: -3 },\n        { label: \"Food bank\", value: -2 },\n        { label: \"Limited choices\", value: -1 },\n        { label: \"Healthy, home cooked\", value: 0 },\n        { label: \"Locally grown &#038; vegan\", value: 1 },\n        { label: \"Organic, regenerative, fairtrade\", value: 2 },\n        { label: \"Mainly vegetarian, low carbon\", value: 3 },\n        { label: \"Meat, dairy\", value: 4 },\n        { label: \"Processed, packaged food\", value: 5 },\n        { label: \"Fertilisers, pesticides\", value: 6 },\n        { label: \"Chemicals, additives, GMO\", value: 7 },\n        { label: \"Globally grown, airmiles\", value: 8 }\n      ]\n    },\n    {\n      id: \"transport\",\n      label: \"Transport\",\n      outreach: 1,\n      options: [\n        { label: \"No access to transport, isolated\", value: -3 },\n        { label: \"Limited\", value: -2 },\n        { label: \"Walking\", value: -1 },\n        { label: \"Biking\", value: 0 },\n        { label: \"Public transport\", value: 1 },\n        { label: \"Shared car scheme user\", value: 2 },\n        { label: \"Neighbourhood car scheme\", value: 3 },\n        { label: \"Small electric car, rail\", value: 4 },\n        { label: \"Small petrol car, rail\", value: 5 },\n        { label: \"Medium petrol car\", value: 6 },\n        { label: \"Large petrol car, short haul flights\", value: 7 },\n        { label: \"SUV, multiple flights long and short haul\", value: 8 }\n      ]\n    },\n    {\n      id: \"property\",\n      label: \"Property\",\n      outreach: 1,\n      options: [\n        { label: \"Homeless \/ unsafe shelter\", value: -3 },\n        { label: \"Severely overcrowded (<10 sqm\/person)\", value: -2 },\n        { label: \"Poor shelter\", value: -1 },\n        { label: \"20 sqm per person per household\", value: 0 },\n        { label: \"30 sqm per person per household\", value: 1 },\n        { label: \"Energy efficient, insulated\", value: 2 },\n        { label: \"40 sqm per person per household\", value: 3 },\n        { label: \"Small, some energy efficient measures\", value: 4 },\n        { label: \"50 sqm per person per household\", value: 5 },\n        { label: \"Very few energy efficient measures\", value: 6 },\n        { label: \"75 sqm living space per person per household\", value: 7 },\n        { label: \"100+ sqm living space per person per household\", value: 8 }\n      ]\n    },\n    {\n      id: \"consumption\",\n      label: \"Consumption\",\n      outreach: 1,\n      options: [\n        { label: \"Unable to afford basic essentials\", value: -2 },\n        { label: \"Peer pressure\", value: -1 },\n        { label: \"Considered purchase\", value: 0 },\n        { label: \"Second hand economy\", value: 1},\n        { label: \"Repair, reduce, renew\", value: 2 },\n        { label: \"Purchase from non local providers\", value: 3 },\n        { label: \"Carbon footprint of goods too high\", value: 4 },\n        { label: \"Purchase of plastic, chemicals\", value: 5 },\n        { label: \"Use of mainstream retailers\", value: 6 },\n        { label: \"Excessive purchasing of new goods\", value: 7 },\n        { label: \"Happiness driven by consumption\", value: 8 }\n      ]\n    },\n    {\n      id: \"energy\",\n      label: \"Energy\",\n      outreach: 1,\n      options: [\n        { label: \"No access\", value: -2 },\n        { label: \"Limited choice\", value: -1 },\n        { label: \"Efficient appliances\", value: 0 },\n        { label: \"Generation of renewables\", value: 1 },\n        { label: \"Use of renewables\", value: 2 },\n        { label: \"Some efficient appliances\", value: 3 },\n        { label: \"Mixture of renewable and non\", value: 4 },\n        { label: \"Use of renewable energy inefficiently\", value: 5 },\n        { label: \"Use of multiple electric appliances\", value: 6 },\n        { label: \"Use of non renewable sources\", value: 7 },\n        { label: \"High energy appliance, lack of insulation\", value: 8 }\n      ]\n    },\n    {\n      id: \"culture\",\n      label: \"Culture\",\n      outreach: 0,\n      options: [\n        { label: \"Depressed\", value: -3 },\n        { label: \"Lonely\", value: -2 },\n        { label: \"Unhappy\", value: -1 },\n        { label: \"Content\", value: 0 },\n        { label: \"Interested in life\", value: 1 },\n        { label: \"Leisure time, active, engaged\", value: 2 },\n        { label: \"Meaningfull work\", value: 3 },\n        { label: \"Perfect work life balance\", value: 4 },\n        { label: \"Family, friends, community\", value: 5 },\n        { label: \"Socialising: food, drink, pub, cinema\", value: 6 },\n        { label: \"Culture, arts, theatre, dance\", value: 7 },\n        { label: \"Sleep, rest, leisure\", value: 8 }\n      ]\n    },\n    {\n      id: \"education\",\n      label: \"Education\",\n      outreach: 0,\n      options: [\n        { label: \"None\", value: -3 },\n        { label: \"No access\", value: -2 },\n        { label: \"Limited\", value: -1 },\n        { label: \"SDG education\", value: 0 },\n        { label: \"High school\", value: 1 },\n        { label: \"University, apprenticeship\", value: 2 },\n        { label: \"Continued learning\", value: 3 },\n        { label: \"Educator of others \/ author\", value: 4 },\n        { label: \"Share knowledge and understanding\", value: 5 },\n        { label: \"Writer, speaker, researcher\", value: 6 },\n        { label: \"Action-led research\", value: 7 },\n        { label: \"Pioneer, lead by example\", value: 8 }\n      ]\n    },\n    {\n      id: \"nature\",\n      label: \"Nature\",\n      outreach: 1,\n      options: [\n        { label: \"None\", value: -3 },\n        { label: \"No access\", value: -2 },\n        { label: \"Limited\", value: -1 },\n        { label: \"Care of nature\", value: 0 },\n        { label: \"Access to wild spaces\", value: 1 },\n        { label: \"Regular connection to nature\", value: 2 },\n        { label: \"Regular access to countryside\", value: 3 },\n        { label: \"Access to wild swimming, growing\", value: 4 },\n        { label: \"Participation in farming\", value: 5 },\n        { label: \"Rewilding restorative care\", value: 6 },\n        { label: \"Self sufficient food growth\", value: 7 },\n        { label: \"Regenerative schemes and wilderness care\", value: 8 }\n      ]\n    }\n  ];\n\n  let currentChart = null;\n  let isPolarView = true;\n\n  function getColorForScoreOutreach(score) {\n    const colors = {\n      \"-3\": { bg: \"rgba(183, 28, 28, 0.85)\", border: \"rgb(183, 28, 28)\" },\n      \"-2\": { bg: \"rgba(229, 57, 53, 0.85)\", border: \"rgb(229, 57, 53)\" },\n      \"-1\": { bg: \"rgba(239, 154, 154, 0.85)\", border: \"rgb(239, 154, 154)\" },\n      \"0\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"1\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"2\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"3\":  { bg: \"rgba(255, 205, 210, 0.85)\", border: \"rgb(239, 154, 154)\" },\n      \"4\":  { bg: \"rgba(239, 154, 154, 0.85)\", border: \"rgb(229, 115, 115)\" },\n      \"5\":  { bg: \"rgba(229, 115, 115, 0.85)\", border: \"rgb(239, 83, 80)\" },\n      \"6\":  { bg: \"rgba(239, 83, 80, 0.85)\", border: \"rgb(229, 57, 53)\" },\n      \"7\":  { bg: \"rgba(229, 57, 53, 0.85)\", border: \"rgb(198, 40, 40)\" },\n      \"8\":  { bg: \"rgba(183, 28, 28, 0.85)\", border: \"rgb(183, 28, 28)\" }\n    };\n    return colors[score] || { bg: \"rgba(200, 200, 200, 0.85)\", border: \"rgb(150, 150, 150)\" };\n  }\n\n  function getColorForScore(score) {\n    const colors = {\n      \"-3\": { bg: \"rgba(183, 28, 28, 0.85)\", border: \"rgb(183, 28, 28)\" },\n      \"-2\": { bg: \"rgba(229, 57, 53, 0.85)\", border: \"rgb(229, 57, 53)\" },\n      \"-1\": { bg: \"rgba(239, 154, 154, 0.85)\", border: \"rgb(239, 154, 154)\" },\n      \"0\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"1\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"2\":  { bg: \"rgba(102, 187, 106, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"3\":  { bg: \"rgba(200, 230, 201, 0.85)\", border: \"rgb(165, 214, 167)\" },\n      \"4\":  { bg: \"rgba(165, 214, 167, 0.85)\", border: \"rgb(129, 199, 132)\" },\n      \"5\":  { bg: \"rgba(129, 199, 132, 0.85)\", border: \"rgb(102, 187, 106)\" },\n      \"6\":  { bg: \"rgba(76, 175, 80, 0.85)\", border: \"rgb(67, 160, 71)\" },\n      \"7\":  { bg: \"rgba(56, 142, 60, 0.85)\", border: \"rgb(46, 125, 50)\" },\n      \"8\":  { bg: \"rgba(27, 94, 32, 0.85)\", border: \"rgb(27, 94, 32)\" }\n    };\n    return colors[score] || { bg: \"rgba(200, 200, 200, 0.85)\", border: \"rgb(150, 150, 150)\" };\n  }\n\n  $(document).ready(function() {\n    renderForm();\n\n    $(\"#btn-randomize\").on(\"click\", function() {\n      categoriesData.forEach(cat => {\n        const randomIndex = Math.floor(Math.random() * cat.options.length);\n        const randomVal = cat.options[randomIndex].value;\n        $(`#${cat.id}`).val(randomVal);\n      });\n      $(\"#error-message\").hide();\n    });\n\n    $(\"#btn-generate\").on(\"click\", function() {\n      if (validateForm()) {\n        $(\"#error-message\").hide();\n        $(\"#assessment-form\").hide();\n        $(\"#results-section\").css(\"display\", \"flex\");\n        isPolarView = true;\n        renderChart();\n      } else {\n        $(\"#error-message\").show();\n      }\n    });\n\n    $(\"#btn-toggle-view\").on(\"click\", function() {\n      isPolarView = !isPolarView;\n      $(this).text(isPolarView ? \"Unroll Doughnut (Switch to Bar Graph)\" : \"Roll Up Doughnut (Switch to Pizza Slice Graph)\");\n      renderChart();\n    });\n\n    $(\"#btn-reset\").on(\"click\", function() {\n      $(\"#results-section\").hide();\n      $(\"#assessment-form\").show();\n      $(\"select\").val(\"\");\n      if (currentChart) {\n        currentChart.destroy();\n      }\n    });\n  });\n\n  function renderForm() {\n    const $container =$(\"#questions-container\");\n    $container.empty();\n\n    categoriesData.forEach(cat => {\n      const $group =$(\"<div>\").addClass(\"form-group\");\n      const $label =$(\"<label>\").attr(\"for\", cat.id).text(cat.label);\n      const $select =$(\"<select>\").attr(\"id\", cat.id).attr(\"name\", cat.id);\n\n      $select.append($(\"<option>\").val(\"\").text(`-- Select option for ${cat.label} --`));\n      cat.options.forEach(opt => {\n        $select.append($(\"<option>\").val(opt.value).text(` ${opt.label}`));\n      });\n\n      $group.append($label).append($select);\n      $container.append($group);\n    });\n  }\n\n  function validateForm() {\n    let isValid = true;\n    categoriesData.forEach(cat => {\n      const val = $(`#${cat.id}`).val();\n      if (val === \"\" || val === null) {\n        isValid = false;\n      }\n    });\n    return isValid;\n  }\n\n  function getAssessmentData() {\n    const labels = [];\n    const values = [];\n    const selectedTexts = [];\n    const bgColors = [];\n    const borderColors = [];\n\n    categoriesData.forEach(cat => {\n      const val = parseInt($(`#${cat.id}`).val(), 10);\n      const outreach = cat.outreach;\n      const selectedOptionText = $(`#${cat.id} option:selected`).text();\n      labels.push(cat.label);\n      values.push(val);\n      selectedTexts.push(selectedOptionText);\n\n      let colors = (outreach === 1) ? getColorForScoreOutreach(val) : getColorForScore(val);\n\n      bgColors.push(colors.bg);\n      borderColors.push(colors.border);\n    });\n\n    return { labels, values, selectedTexts, bgColors, borderColors };\n  }\n\n  function renderChart() {\n    const data = getAssessmentData();\n    const ctx = document.getElementById(\"doughnutChart\").getContext(\"2d\");\n\n    if (currentChart) {\n      currentChart.destroy();\n    }\n\n    if (isPolarView) {\n      const visualRadiusData = data.values.map(v => v + 4);\n\n      currentChart = new Chart(ctx, {\n        type: 'polarArea',\n        data: {\n          labels: data.labels,\n          datasets: [{\n            data: visualRadiusData,\n            backgroundColor: data.bgColors,\n            borderColor: data.borderColors,\n            borderWidth: 2\n          }]\n        },\n        options: {\n          responsive: true,\n          maintainAspectRatio: false,\n          layout: {\n            padding: 50\n          },\n          scales: {\n            r: {\n              min: 0,\n              max: 13,\n              ticks: { display: false, stepSize: 2 },\n              grid: { display: false },\n              pointLabels: { display: false }\n            }\n          },\n          plugins: {\n            legend: { display: false },\n            title: { display: false },\n            tooltip: {\n              callbacks: {\n                label: function(context) {\n                  const idx = context.dataIndex;\n                  return [\n                    `Category: ${data.labels[idx]}`,\n                    `Answer: ${data.selectedTexts[idx]}`\n                  ];\n                }\n              }\n            }\n          }\n        }\n      });\n    } else {\n      currentChart = new Chart(ctx, {\n        type: 'bar',\n        data: {\n          labels: data.labels.map(l => l.toUpperCase()),\n          datasets: [{\n            label: 'Category Score',\n            data: data.values,\n            backgroundColor: data.bgColors,\n            borderColor: data.borderColors,\n            borderWidth: 1\n          }]\n        },\n        options: {\n          responsive: true,\n          maintainAspectRatio: false,\n          layout: {\n            padding: 10\n          },\n          scales: {\n            x: {\n              title: {\n                display: true,\n                text: 'CATEGORIES',\n                font: { weight: 'bold', size: 14 }\n              },\n              ticks: {\n                font: { weight: 'bold', size: 11 }\n              }\n            },\n            y: {\n              min: -3,\n              max: 8,\n              ticks: { stepSize: 2 },\n              title: {\n                display: true,\n                text: 'Score (-3 to 8)',\n                font: { weight: 'bold', size: 12 }\n              }\n            }\n          },\n          plugins: {\n            legend: { display: false },\n            title: { display: false },\n            tooltip: {\n              callbacks: {\n                title: function(context) {\n                  const idx = context[0].dataIndex;\n                  return `Category: ${data.labels[idx].toUpperCase()}`;\n                },\n                label: function(context) {\n                  const idx = context.dataIndex;\n                  return [\n                    `Selected Answer: ${data.selectedTexts[idx]}`\n                  ];\n                }\n              }\n            }\n          }\n        }\n      });\n    }\n  }\n})(jQuery);\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>My Personal Doughnut Self-Assessment Please select an option for all 9 categories before generating the graph. Generate Personal Doughnut Unroll Doughnut (Switch to Bar Graph) Reset Assessment<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/posts\/196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/comments?post=196"}],"version-history":[{"count":4,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/posts\/196\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.exo-bit.hr\/index.php\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}