我使用dimple.js库创建了一个图表,其中包含以下代码:
foreach (ListViewItem selectedItem in listView1.SelectedItems)
{
label1.Text = selectedItem.Text;
break; // remove it if you have multiple selection but you need thread as well with Thread.Sleep.
}
//OR
label1.Text = listView1.SelectedItems[0].Text;
我试图使用d3来选择图表的x和y轴来改变它们,但html元素几乎完全相同,所以我不知道如何单独选择它们。使用var count = 1;
foreach (ListViewItem selectedItem in listView1.SelectedItems)
{
label1.Text = "Number" + count++;
break; // remove it if you have multiple selection but you need thread as well with Thread.Sleep.
}
我已经能够为x轴(列出的第一个元素)添加唯一标识符,但我无法选择y轴。
这是HTML代码:
X轴:var myChart = new dimple.chart(svg, data);
var x = myChart.addMeasureAxis("x", "x-measure");
x.tickFormat = "%";
var y = myChart.addMeasureAxis("y", "y-measure");
y.tickFormat = "%";
myChart.addSeries(["Attribute", "Category"], dimple.plot.scatter);
myChart.draw();
Y轴:d3.select('.dimple-axis').attr("id","x-axis");
有关如何永久地将唯一ID添加到y轴的任何想法,或以某种方式使用d3选择它?
谢谢!