瀏覽代碼

Added gradient on TimeTable

master
tr4ck3ur des JM2L 9 年之前
父節點
當前提交
f0f228f173
共有 2 個文件被更改,包括 18 次插入12 次删除
  1. +11
    -7
      jm2l/static/img/shadow.svg
  2. +7
    -5
      jm2l/static/js/programme.js

+ 11
- 7
jm2l/static/img/shadow.svg 查看文件

@@ -12,13 +12,17 @@
<feMergeNode in="SourceGraphic"/> <feMergeNode in="SourceGraphic"/>
</feMerge> </feMerge>
</filter> </filter>
<linearGradient id="BoxGradient"
x1="0%" y1="0%"
x2="0%" y2="100%"
spreadMethod="pad">
<stop offset="0%" fill-opacity="1" stop-opacity="1"/>
<stop offset="100%" stop-opacity="1"/>
<linearGradient id="BoxGradient-Conference" spreadMethod="pad" x1="100%" y1="0%" x2="50%" y2="100%">
<stop offset="0%" stop-color="#EEE" stop-opacity="0"/>
<stop offset="15%" stop-color="#f9fde8" stop-opacity="1"/>
</linearGradient>
<linearGradient id="BoxGradient-Atelier" spreadMethod="pad" x1="100%" y1="0%" x2="50%" y2="100%">
<stop offset="0%" stop-color="#EEE" stop-opacity="0"/>
<stop offset="15%" stop-color="#faebeb" stop-opacity="1"/>
</linearGradient>
<linearGradient id="BoxGradient-Table-ronde" spreadMethod="pad" x1="100%" y1="0%" x2="50%" y2="100%">
<stop offset="0%" stop-color="#EEE" stop-opacity="0"/>
<stop offset="15%" stop-color="#fff4e5" stop-opacity="1"/>
</linearGradient> </linearGradient>
</defs> </defs>
</svg> </svg>

+ 7
- 5
jm2l/static/js/programme.js 查看文件

@@ -119,14 +119,14 @@ function HandleEvents(Ctrl) {


function displayit(Set_of_Task, Set_of_Area, key) { function displayit(Set_of_Task, Set_of_Area, key) {
// Try to compute time range // Try to compute time range
Set_of_Task.sort(function(a, b) {
return a.endDate - b.endDate;
});
timeDomainEnd = Set_of_Task[Set_of_Task.length - 1].endDate;
Set_of_Task.sort(function(a, b) { Set_of_Task.sort(function(a, b) {
return a.startDate - b.startDate; return a.startDate - b.startDate;
}); });
timeDomainStart = Set_of_Task[0].startDate; timeDomainStart = Set_of_Task[0].startDate;
Set_of_Task.sort(function(a, b) {
return a.endDate - b.endDate;
});
timeDomainEnd = Set_of_Task[Set_of_Task.length - 1].endDate;


// Prepare scales // Prepare scales
xScale = d3.scale.ordinal() xScale = d3.scale.ordinal()
@@ -197,7 +197,9 @@ function displayit(Set_of_Task, Set_of_Area, key) {
.attr("rx", 5) .attr("rx", 5)
.attr("ry", 5) .attr("ry", 5)
.attr("filter", "url(/img/shadow.svg#dropshadow)") .attr("filter", "url(/img/shadow.svg#dropshadow)")
//.attr("style", "fill:url(/img/shadow.svg#BoxGradient)")
.attr("style", function(d){
return "fill:url(/img/shadow.svg#BoxGradient-"+ taskStatus[d.status] +")"
})
.attr("class", function(d){ .attr("class", function(d){
if(taskStatus[d.status] == null) if(taskStatus[d.status] == null)
{ return "bar";} { return "bar";}


Loading…
取消
儲存