Charts

Donut Chart : Customer Satisfaction
Customer Satisfaction
  • Positive
    8.3%
    228
  • Negative
    -0.13%
    34
Documentation
Available Parameters
Parameter Type Description
baseId Unique Text
required
Set Unique Base ID for Chart.
title Text
required
Set title of Chart.
height Number Set height for chart in pixels.
legend Array of Legend Set list of legend for chart.
Example:
[
    {
        "name"     : "Positive",
        "value"    : "228",
        "color"    : "#1F58D4",

        "trend"    : "<span class=\"trend-up\">8.3%</span>",
    }
]
actions Array of Action Item Set list of actions for chart.
Example:
[
    {
        "text"    : "Action 1",
        "link"    : "javascript:void()"
    }
]
data Array of Data Object
required
Set list of Data item.
Example:
[
    {
        "name"     : "Positive",
        "value"    : 228,
        "itemStyle"    : {
            "color"    : "#1F58D4"
        },
    }
]
options Options Object Set Options for chart.
More about options see https://echarts.apache.org/en/option.html
Example:
{
    "series"    : [
        {
            "radius"        : ["74%", "100%"],
            "startAngle"    : -46
        }
    ]
}
Starter Kit Codes
Starter Kit Code
 {# include charts/pie  #}
 {% include "../../charts/pie.twig", with {
    	"baseId"	: "example-chart-customer-satisfaction",

	"title"	: "Customer Satisfaction",

	"height"	: 214,

	"legend"	: [
		{
			"name"	: "Completed Courses",
			"value"	: "26 Courses",
			"color"	: "#1F58D4",

			"trend"	: "<span class=\"trend-up\">30%</span>",
		},
		{
			"name"	: "Dropped Courses",
			"value"	: "3 Courses",
			"color"	: "#001F63",

			"trend"	: "<span class=\"trend-up\">25%</span>",
		},
		{
			"name"	: "Refund Claimed",
			"value"	: "7 Courses",
			"color"	: "#93B1F4",

			"trend"	: "<span class=\"trend-down\">20%</span>",
		},
		{
			"name"	: "On-going Courses",
			"value"	: "12 Courses",
			"color"	: "#F9BD29",

			"trend"	: "<span class=\"trend-up\">17%</span>",
		},
	],
	"legendStyle"	: "chart-legend-style-table",

	"action"	: {
		"text"	: "See Details",
		"link"	: "javascript:void()",
	},

	"data"	: [
		{
			"name"	: "Completed Courses",
			"value"	: 26,
			"itemStyle"	: {
				"color"	: "#1F58D4"
			},
		},
		{
			"name"	: "Dropped Courses",
			"value"	: 3,
			"itemStyle"	: {
				"color"	: "#001F63"
			},
		},
		{
			"name"	: "Refund Claimed",
			"value"	: 7,
			"itemStyle"	: {
				"color"	: "#93B1F4"
			},
		},
		{
			"name"	: "On-going Courses",
			"value"	: 12,
			"itemStyle"	: {
				"color"	: "#F9BD29"
			},
		},
	],

	"options"	: {
	}
 } %}