我正在尝试使用Chart.Js构建图表.这个chart.js有工具提示的默认选项,我想制作自定义的工具提示选项.有没有办法让它成为可能?
这是我的代码
var chart = null;
barChart: function (data1, data2, data3, label) {
var data = {
labels: label,
datasets: [
{
fillColor: "rgba(220,220,220,0.5)",
strokeColor: "rgba(220,220,220,0.8)",
highlightFill: "rgba(220,220,220,0.75)",
highlightStroke: "rgba(220,220,220,1)",
data: data1
},
{
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,0.8)",
highlightFill: "rgba(151,187,205,0.75)",
highlightStroke: "rgba(151,187,205,1)",
data: data2
},
{
fillColor: "rgba(0,255,0,0.3)",
strokeColor: "rgba(220,220,220,0.8)",
highlightFill: "rgba(220,220,220,0.75)",
highlightStroke: "rgba(0,255,0,0.3)",
data: data3
},
]
}
var cht = document.getElementById('exampleCanvas');
var ctx = cht.getContext('2d');
if (chart)
chart.destroy();
chart = new Chart(ctx).Bar(data);
}
Run Code Online (Sandbox Code Playgroud) 有人能帮助我吗?这是我的代码
var $from=$("#fromDate").datepicker('getDate');
var $to =$("#toDate").datepicker('getDate');
if($from>$to)
alert("from date shouldn't greater than To date");
Run Code Online (Sandbox Code Playgroud)
它是在同一年的两个日期工作.否则例如fromDate ='1/12/2012'(dd/mm/yyyy)toDate = '18/6/2013'(dd/mm/yyyy),当你检查条件时,它不起作用.它抛出警报,我给了.
如何使用jQuery隐藏除current(clicked Row)之外的所有行?
当我单击除当前行之外的特定行时,我想要隐藏所有行.
<table>
@foreach (var item in Model)
{
idValue++;
<tr class="tableRow" id="@idValue">
<td class="master" id="@item.Batch_Seq">
<a href= "#" >@(item.Batch_Name)></a>
</td>
<td>
@(item.Present)
</td>
<td>
@(item.Absent)
</td>
<td>
@(item.HalfDay)
</td>
<td>
@(item.Batch_count)
</td>
</tr>
}
</table>
Run Code Online (Sandbox Code Playgroud)
我试过这样的
$('.tableRow').hide();
$(this).closest('tr:not(.tableRow)').hide();
Run Code Online (Sandbox Code Playgroud)
谁能帮助我?