当显示以下图表时(仍在工作)。我收到以下错误:
Error: <g> attribute transform: Expected number, "translate(NaN, 0)".
Run Code Online (Sandbox Code Playgroud)
我的代码如下:
var Attempts = c3.generate({
bindto: '#attempts',
data: {
url: 'attempts.csv',
x:"index",
type: 'donut',
onclick: function (d, i) { console.log("onclick", d, i); },
onmouseover: function (d, i) { console.log("onmouseover", d, i); },
onmouseout: function (d, i) { console.log("onmouseout", d, i); }
},
donut: {
label: {
format: function (value) { return value; }
}
}
});
Run Code Online (Sandbox Code Playgroud)
attempts.csv 是:
index,Basic Mechanics,Basic Thermodynamics,Calculus I,Calculus II,Chemistry I,Chemistry II,Engineering Drawing,Fundamentals of Informatics,Geometry,Linear Algebra
ATTEMPTS,1.416,1.404,1.421,1.347,1.305,1.246,1.261,1.456,1.325,1.385
Run Code Online (Sandbox Code Playgroud)
完整的错误是: …
我正在尝试这段代码,无法摆脱错误"ByRef参数类型不匹配".
我已经将i和j声明为整数,并且我已经将ByRef放在DisplayTreeHelp函数中,以便在我完成执行DisplayTreeHelp函数后保留i和j的值.(否则该值将返回到输入DisplayTreeHelp之前的值).但是,如果我没有在DisplayTreeHelp函数中指定ByRef,则保持该值.
Public Sub DisplayTree()
'Given country
Dim country As String
country = Sheets("Tree").Range("Country").Value2
'Start cell
Dim start As Range
Set start = Range("A2")
Dim dic1 As Dictionary
Dim key1 As Variant
Dim i, i_max As Integer
Dim j, j_max As Integer
Set dic1 = CreateTree
'Column start
j = start.Column
j_max = j
'Row start
i = start.Row
i_max = i
Dim tempArrSize As Long
tempArrSize = 1
Dim tempArr1() As Variant
ReDim tempArr1(1 To 1)
'Iterate dictionary to …
Run Code Online (Sandbox Code Playgroud)