我正在使用 flot 库创建一个折线图,并且在 y 轴上,我所有的刻度都是缩写,我想将我的所有刻度都设为超链接,因此在打开页面时,他们会获得有关 abb 的更多详细信息。
这是我制作y轴的代码:
var ranks = Context.CreateDataContext().Ranks.OrderBy(c => c.RankID);
var yaxis = new StringBuilder(" { yaxis : {ticks:[");
foreach (var item in ranks)
{
if (item.RankID == 0)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "None");
if (item.RankID == 1)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "AMB");
if (item.RankID == 2)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "BA");
if (item.RankID == 3)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "SA");
if (item.RankID == 4)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "GA");
if (item.RankID == 5)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "PA");
if (item.RankID == 6)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "RA");
if (item.RankID == 7)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "EA");
if (item.RankID == 8)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "DA");
if (item.RankID == 9)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "DDA");
if (item.RankID == 10)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "TDA");
if (item.RankID == 11)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "PDA");
if (item.RankID == 12)
yaxis.AppendFormat(@"[{0},'{1}'],", item.RankID, "CDA");
}
yaxis.Append("]}}");
我想将“AMB”、“BA”、“SA”、“GA”..全部作为链接或工具提示..
谢谢!!