asp.net - zed graph x axis labels -
i trying loop through datatable column sdescr , use text in columns labels of x axis, isnt working getting error
value of type 'system.collections.generic.list(of string)' cannot converted '1-dimensional array of string'.
for integer = 0 mycurve1.points.count - 1 dim pt pointpair = mycurve1.points(i) ' create text label y data value dim text new textobj(pt.y.tostring("f0"), pt.x, pt.y + 0.1, coordtype.axisxyscale, alignh.left, alignv.center) text.zorder = zorder.a_infront text.fontspec.angle = 90 mypane.graphobjlist.add(text) dim labels new list(of string) each row datarow in tablegraph.rows labels = row.item("sdescr") next row mypane.xaxis.scale.textlabels = labels mypane.xaxis.type = axistype.text next
you need remove code labels out of next loop creating points.
which means this
dim labels new list(of string) each row datarow in tablegraph.rows labels = row.item("sdescr") next row mypane.xaxis.scale.textlabels = labels mypane.xaxis.type = axistype.text
now, outside of loop plotting points, need go through datatable
please @ error you're getting... list of string can't converted string array. objects aren't equivalent.
one option (after loop plot points)
dim labels(tablegraph.rows.count - 1) string integer = 0 tablegraph.rows.count - 1 labels(i) = tablegraph.row(i).item("sdescr") next mypane.xaxis.scale.textlabels = labels mypane.xaxis.type = axistype.text
i don't have zed here on computer, haven't checked in visual studio, should give decent direction.
Comments
Post a Comment