Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知鸟1号
tabler
提交
ba1e1fef
T
tabler
项目概览
知鸟1号
/
tabler
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tabler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ba1e1fef
编写于
12月 19, 2019
作者:
C
codecalm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
charts extend, new params
上级
fb841faf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
70 addition
and
14 deletion
+70
-14
pages/_data/charts.yml
pages/_data/charts.yml
+27
-0
pages/_includes/ui/chart.html
pages/_includes/ui/chart.html
+22
-7
pages/_plugins/jekyll-filters.rb
pages/_plugins/jekyll-filters.rb
+8
-0
pages/tmp.html
pages/tmp.html
+13
-7
未找到文件。
pages/_data/charts.yml
浏览文件 @
ba1e1fef
...
...
@@ -6,6 +6,33 @@ completion-tasks:
-
name
:
Tasks completion
data
:
[
155
,
65
,
465
,
265
,
225
,
325
,
80
]
completion-tasks2
:
extend
:
completion-tasks
type
:
line
completion-tasks3
:
extend
:
completion-tasks
type
:
area
completion-tasks4
:
extend
:
completion-tasks
stroke-curve
:
straight
type
:
line
completion-tasks5
:
extend
:
completion-tasks
stroke-curve
:
stepline
type
:
line
completion-tasks6
:
extend
:
completion-tasks
type
:
bar
horizontal
:
true
completion-tasks7
:
extend
:
completion-tasks
type
:
line
datalabels
:
true
tasks-overview
:
type
:
bar
...
...
pages/_includes/ui/chart.html
浏览文件 @
ba1e1fef
{% assign data = site.data.charts[include.chart-id] %}
{% assign id = include.id | default: include.chart-id %}
{% assign height = include.height | default: 10 %}
{% assign class = include.class
| default: ''
%}
{% assign class = include.class %}
{% if include['size'] == 'sm' %}
{% assign class = class | append: ' chart-sm' | strip %}
...
...
@@ -9,8 +9,11 @@
{% endif %}
{% if data %}
<div
id=
"chart-{{ id }}"
{%
if
class
%}
class=
"{{ class }}"
{%
endif
%}{%
if
data.debug
%}
style=
"outline: 1px solid red"
{%
endif
%}
></div>
{% if data.extend %}
{% assign data = site.data.charts[data.extend] | concat_objects: site.data.charts[include.chart-id] %}
{% endif %}
<div
id=
"chart-{{ id }}"
{%
if
class
%}
class=
"{{ class }}"
{%
endif
%}{%
if
data.debug
%}
style=
"outline: 1px solid red"
{%
endif
%}
></div>
{% append_lib apexcharts %}
{% capture script %}
...
...
@@ -21,12 +24,10 @@
window
.
tabler_chart
=
window
.
tabler_chart
||
{};
{
%
endif
%
}
window
.
ApexCharts
&&
({
%
if
jekyll
.
environment
==
'
development
'
%
}
window
.
tabler_chart
[
"
chart-{{ include.chart-id }}
"
]
=
{
%
endif
%
}
new
ApexCharts
(
document
.
getElementById
(
'
chart-{{ id }}
'
),
{
window
.
ApexCharts
&&
({
%
if
jekyll
.
environment
==
'
development
'
%
}
window
.
tabler_chart
[
"
chart-{{ include.chart-id }}
"
]
=
{
%
endif
%
}
new
ApexCharts
(
document
.
getElementById
(
'
chart-{{ id }}
'
),
{
chart
:
{
type
:
"
{{ data.type }}
"
,
{
%
if
data
.
title
%
}
{
%
if
data
.
title
or
data
.
type
==
"
bar
"
or
data
.
type
==
"
line
"
%
}
fontFamily
:
'
inherit
'
,
{
%
endif
%
}
height
:
{{
height
|
times
:
16
}},
...
...
@@ -52,6 +53,20 @@
{
%
endif
%
}
},
{
%
if
data
.
type
==
'
bar
'
and
data
.
horizontal
%
}
plotOptions
:
{
bar
:
{
horizontal
:
true
,
}
},
{
%
endif
%
}
{
%
if
data
.
datalabels
%
}
dataLabels
:
{
enabled
:
true
,
},
{
%
endif
%
}
fill
:
{
opacity
:
{
%
if
data
.
type
==
'
area
'
%
}.
16
{
%
else
%
}
1
{
%
endif
%
},
{
%
if
data
.
type
==
'
area
'
%
}
type
:
'
solid
'
{
%
endif
%
}
...
...
pages/_plugins/jekyll-filters.rb
浏览文件 @
ba1e1fef
...
...
@@ -80,6 +80,14 @@ module Jekyll
"rgb(
#{
r
.
hex
}
,
#{
g
.
hex
}
,
#{
b
.
hex
}
)"
end
def
concat_objects
(
object
,
object2
)
if
object
and
object2
and
object
.
is_a?
(
Hash
)
and
object2
.
is_a?
(
Hash
)
return
object
.
merge
(
object2
)
end
object
end
def
tabler_color
(
color
,
variation
=
false
)
if
variation
color
=
color
+
'-'
+
variation
...
...
pages/tmp.html
浏览文件 @
ba1e1fef
...
...
@@ -3,13 +3,19 @@ tmp: true
---
<div
class=
"row"
>
<div
class=
"col-md-6 col-lg-4"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
{% include ui/chart.html chart-id="completion-tasks" height=15 %}
</div>
</div>
</div>
{% assign charts = 'completion-tasks,completion-tasks2,completion-tasks3,completion-tasks4,completion-tasks5,completion-tasks6,completion-tasks7' | split: ',' %}
{% for chart in charts %}
<div
class=
"col-md-6 col-lg-4"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
{% include ui/chart.html chart-id=chart height=15 %}
</div>
</div>
</div>
{% endfor %}
<div
class=
"col-12"
>
<div
class=
"card"
>
<div
class=
"card-body"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录