Introducing CrudHunt:Open-source Full-stack CRUDs for Next.js by KeenThemes
Browse CrudHunt

Data setup for doughnut chart in good theme


Hi, i have been working with good
KeenThemes -https://preview.keenthemes.com/good/index.html


i would like to know about the configuration and data inserted in the graph.

As i have got the following code from your widget.js but i when i add the dynamic values the blue coloured in Expected earning graph fills up the full circle in doughnut chart. if i try to insert value as numbers instead of decimal.


var KTCardsWidget4 = {
init: function() {
! function() {
var e = document.getElementById("kt_card_widget_4_chart");
if (e) {
var t = {
size: e.getAttribute("data-kt-size") ? parseInt(e.getAttribute("data-kt-size")) : 70,
lineWidth: e.getAttribute("data-kt-line") ? parseInt(e.getAttribute("data-kt-line")) : 11,
rotate: e.getAttribute("data-kt-rotate") ? parseInt(e.getAttribute("data-kt-rotate")) : 145
},
a = document.createElement("canvas"),
o = document.createElement("span");
"undefined" != typeof G_vmlCanvasManager && G_vmlCanvasManager.initElement(a);
var r = a.getContext("2d");
a.width = a.height = t.size, e.appendChild(o), e.appendChild(a), r.translate(t.size / 2, t.size / 2), r.rotate((t.rotate / 180 - .5) * Math.PI);
var i = (t.size - t.lineWidth) / 2,
s = function(e, t, a) {
a = Math.min(Math.max(0, a || 1), 1), r.beginPath(), r.arc(0, 0, i, 0, 2 * Math.PI * a, !1), r.strokeStyle = e, r.lineCap = "round", r.lineWidth = t, r.stroke()
};
s("#E4E6EF", t.lineWidth, 1), s(KTUtil.getCssVariableValue("--bs-danger"), t.lineWidth, 100/150), s(KTUtil.getCssVariableValue("--bs-primary"), t.lineWidth, .5)
}
}()
}
};


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (0)