2

我正在使用 KendoUI,并创建了以下图表。在这种情况下,我需要能够使图例项“产品 1”成为超链接。我怎么做?

我的标记:

<div id='chart' ></div>​

我的脚本:

 jQuery('#chart').kendoChart({
seriesDefaults: {
    type: "line",
    missingValues: "interpolate"
},
legend: {
    position: "bottom"
},
valueAxis: [{
    title: {
        text: "Score"
    },
    min: 75,
    max: 90,
    },
{
    name: "hidden",
    visible: false,
    min: 75,
    max: 90},
{
    name: "ProductSurveys",
    min: 15,
    max: 55,
    title: {
        text: "Survey Count"
    },
    color: "#4c4c4c"}],
series: [{
    type: "line",
    name: "<a href='http://jsfiddle.net/rodneyhickman/wCB5a/' >Product 1</a>",
    color: "#004990",
    width: 1,
    markers: {
        background: "#004990"
    },
    tooltip: {
        visible: true,
        template: "<b>Product 1</b><br/>Current Score: #= value #<br/>#= category # "
    },
    data: [87.11, 87.27, 87.21, 86.84, 85.47, 84.87, 84.52, 85.19, 85.19, 85.2, 84.68, 83.78, 82.14]},
{
    type: "line",
    name: "Market Segment Average",
    color: "#da7633",
    width: 1,
    markers: {
        background: "#da7633"
    },
    tooltip: {
        visible: true,
        template: "<b>Market Segment Average</b><br/>Current Score: #= value #<br/>#= category # "
    },
    data: [77.73, 77.27, 77.22, 76.68, 76.19, 75.7, 75.86, 76.09, 76.33, 76.15, 75.75, 75.4, 75.9]},
{
    type: "column",
    data: [50, 48, 48, 46, 46, 48, 49, 46, 39, 37, 36, 34, 27],
    name: "Survey Count",
    color: "#e9eafe",
    axis: "ProductSurveys"}],
categoryAxis: {
    labels: {
        rotation: -45,
        step: 1,
        skip: 0
    },
    categories: ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan - 2012", "Feb", "Mar", "Apr"],
    axisCrossingValue: [0, 0, 100, 100]
}

});​</p>

这是我尝试失败的 jsFiddle 项目:http: //jsfiddle.net/wCB5a/1/

任何帮助,将不胜感激。

4

1 回答 1

3

Telerik 让我知道 KendoUI(版本 2012.1.233)中当前不存在此功能,并且已注意到该功能,并且可能在未来的版本中。

我解决这个问题的方法是隐藏图例。使用超链接创建我自己的图例。

于 2012-05-03T15:12:49.220 回答