Charts
XY Chart : Report for this week
Report for this week
-
View
-
Visitor
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
|
Boolean
Default : false
|
Set true value for legend parameter to display chart legend base on series. |
actions
|
Array of Action Item | Set list of actions for chart. Example: [
|
data
|
Array of Data Object
required |
Set list of Data item. Example: [
|
options
|
Options Object
required |
Set Options for chart. required attributes : xAxis.dataKey, series[ { item.dataKey } ]more about options see https://echarts.apache.org/en/option.html Example: {
|
Starter Kit Codes
Starter Kit Code
{# include charts/xy #}
{% include "../../charts/xy.twig", with {
"baseId" : "example-chart-report-weekly",
"title" : "Report for this week",
"height" : 365,
"legend" : true,
"actions" : [
{
"text" : "Action 1",
"link" : "javascript:void()"
},
{
"text" : "Action 2",
"link" : "javascript:void()"
},
{
"text" : "Action 3",
"link" : "javascript:void()"
},
],
"data" : [
{
"date" : "2024/06/02",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/03",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/04",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/05",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/06",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/07",
"view" : 65,
"visitor" : 78,
},
{
"date" : "2024/06/08",
"view" : 65,
"visitor" : 78,
}
],
"options" : {
"xAxis" : {
"type" : "time",
"dataKey" : "date",
"axisLabel" : {
"formatter" : "{ee}"
}
},
"yAxis" : {
"interval" : 20,
"min" : 0,
"max" : 100,
"axisLabel" : {
"formatter" : "{value} hr"
}
},
"series" : [
{
"dataKey" : "view",
"type" : "bar",
"name" : "View",
"itemStyle" : {
"color" : "#93B1F4"
},
},
{
"dataKey" : "visitor",
"type" : "bar",
"name" : "Visitor",
"itemStyle" : {
"color" : "#1F58D4"
},
},
],
}
} %}