我正在使用chart.js插件并通过栏视图使用组图表.当我悬停一组酒吧时,我可以看到一个工具提示,向我显示这些酒吧的数据.但是当我将鼠标悬停在数据栏上时,我要更改工具提示以显示我唯一的单个数据.而我该如何显示不同的数据信息. jsfiddle的例子
var ctx = document.getElementById("errorChart").getContext("2d");
var data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
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: [65, 0, 0, 0, 0, 0, 0]
},
{
label: "My Second dataset",
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: [28, 48, 40, 19, 86, 27, 90]
}
]
};
var myBarChart = new Chart(ctx).Bar(data);
Run Code Online (Sandbox Code Playgroud) 我想插入var contacts: [CNContact] = []
的var store = CNContactStore(),但我没有找到合适的代码这份工作,我发现这个功能,我需要给一个名字
func findContactsWithName(name: String) {
AppDelegate.sharedDelegate().checkAccessStatus({ (accessGranted) -> Void in
if accessGranted {
dispatch_async(dispatch_get_main_queue(), { () -> Void in
do {
let predicate: NSPredicate = CNContact.predicateForContactsMatchingName(name)
let keysToFetch = [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactBirthdayKey, CNContactViewController.descriptorForRequiredKeys()]
self.contacts = try self.store.unifiedContactsMatchingPredicate(predicate, keysToFetch:keysToFetch)
self.tableView.reloadData()
}
catch {
print("Unable to refetch the selected contact.")
}
})
}
})
}
Run Code Online (Sandbox Code Playgroud)
我想插入self.contacts所有记录,而不只是一个名称相等的记录
我有一个ngFor for rows和我点击某些单元格以使其可编辑
<tr *ngFor="let invoice of invoiceItem.rows">
<td contenteditable='true' (input)="onRowClick($event, invoice.rowId)">{{ invoice.rowName }}</td>
<td>{{ invoice.hours}}</td>
<td>{{ invoice.price }}</td>
<td>{{ invoice.comments }}</td>
<td>{{ invoice.total}} </td>
</tr>
Run Code Online (Sandbox Code Playgroud)
更多的是我添加了新行来支持它
<button (click)='addRow()'>Add a row</button>
addRow() {
this.invoiceItem.rows.push({
invoiceDetailsId: this.invoiceItem.item.invoiceId,
rowName: '',
hours: 0,
price: 0,
comments: '',
total: 0,
rowId:
})
}
onRowClick(event, id) {
console.log(event.target.outerText, id);
}
Run Code Online (Sandbox Code Playgroud)
我应该为这项任务实施什么?
我有一个 python 脚本,可以在远程 SUT 上执行自动化脚本。并且考虑到该脚本在使用用户 tester 和密码 xxx 在本地执行时正常工作。
当我构建 DevOps Azure 管道时,我已从 GIT 将项目签出到代理中,然后尝试从命令行执行代码。
cd .\MatrixPro\TestFramework
python .\main.py -t profaund_tests.matrix_pro_rf_energy_across_impedances
Run Code Online (Sandbox Code Playgroud)
这段代码给了我一个错误
E PermissionError: [WinError 5] 访问被拒绝: '//192.168.1.100\c$\'
似乎该脚本尝试在 SUT 上创建报告文件,但没有权限。
更重要的是,天蓝色用户代理具有管理员权限,但我怀疑在执行命令之前我需要更改为本地用户。
注意:我正在 Windows 10 上工作。
解决这个问题的正确方法是什么?我怎样才能找出这个错误发生的方式?
他们是更改管道权限以使用本地用户和密码在本地代理上工作的简单方法吗?
我有一个问题,返回我的跟随错误
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at graphsshahar.TestDijkstra.main(TestDijkstra.java:38)
Run Code Online (Sandbox Code Playgroud)
我的程序得到一个对象列表,我需要在列表中找到等于一个,然后打印它,这是代码
public static void main (String [] args){
System.out.println("begin");
int one = 2;
int two = 10;
List<Conniction> tempDeal = ConnictionDAO.getInstance().findPath(one, two);
List<String> oneid = new ArrayList<String>();
List<String> twoid = new ArrayList<String>();
for (int j = 1; j <= tempDeal.size(); j++) {
System.out.println("get");
if( Integer.parseInt(tempDeal.get(j).getOneid()) == one )
{
oneid.add(tempDeal.get(j).getOneid());
System.out.println(oneid.get(j));
}
}
System.out.println("end");
Run Code Online (Sandbox Code Playgroud)
我该修理什么?我不知道if语句有什么问题
我无法读取xml并解析项目,因为它总是返回错误
groovy.lang.MissingPropertyException:没有这样的属性:类的方法:Script1
def xmlText = new XmlSlurper().parse('myxml.xml')
def skipped = 0
def failed = 0
def total = 0
def passed = 0
xmlText.suite.test.class.test-method.each{
if(it['@is-config'] == "true"){
}
else{
if(it['@status']=="PASS"){
passed = passed + 1
total = total + 1
}
if(it['@status']=="FAIL"){
failed = failed + 1
total = total + 1
}
if(it['@status']=="SKIP"){
skipped = skipped + 1
total = total + 1
}
}
}
Run Code Online (Sandbox Code Playgroud)
xml文件是
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="3" failed="0" total="3" passed="0">
<reporter-output>
</reporter-output>
<suite name="DinamicTestSuite" …Run Code Online (Sandbox Code Playgroud) angular ×1
azure-devops ×1
bar-chart ×1
chart.js ×1
cncontact ×1
command-line ×1
groovy ×1
html ×1
ios ×1
java ×1
javascript ×1
jenkins ×1
jquery ×1
swift ×1
typescript ×1
xmlslurper ×1