Hi. I have the following chart...
$("#chart").kendoChart({
//datasource
//chartArea: {
// background: "#282828"
//},
//legend: { visible: false },
seriesClick: onSeriesClick,
render: onRender,
dataSource: { transport: { read: { url: sUrl, type: "get" } }, sort: [{ field: "Tunit", dir: "asc" }, { field: "SelGrp", dir: "asc" }], group: { field: "SelGrp" } },
title: { text: "Statistics" },
legend: { position: "top" },
series: [
{ field: "AvgBitRateInS", categoryField: "Tunit", missingValues: "gap",visibleInLegend: sTorF, name: "AvgBitRate In (Kb/s)", type: "line", style: "smooth", axis: "BitRateIn", hidden: "HideIn", tooltip: { visible: true, template: "#= dataItem.SelGrp #<br/>${category}<br/> AvgBitRate In - ${value} (Kb/s)" }, },
{ field: "AvgBitRateOutS", categoryField: "Tunit", missingValues: "gap",visibleInLegend: true, name: "AvgBitRate Out (Kb/s)", type: "line", style: "smooth", axis: "BitRateOut", hidden: "HideOut", tooltip: { visible: true, template: "#= dataItem.SelGrp #<br/>${category}<br/> AvgBitRate Out - ${value} (Kb/s)" }, },
{ field: "Drops", categoryField: "Tunit", visibleInLegend: false, name: "Drops", colorField: "userColor", type: "column", axis: "Drops", tooltip: { visible: true, template: "#= dataItem.SelGrp #<br/>${category}<br/>Drops - ${value}" } }
],
categoryAxis: {
axisCrossingValues: [999999,999999, 0],
justified: true,
//field: "Tunit",
labels: { rotation: -90 }
},
valueAxes: [
{
name: "BitRateIn",
title: { text: "Avg Bitrate In" },
color : "green"
},
{
name: "BitRateOut",
title: { text : "Avg Bitrate Out"},
color : "olive"
},
{
name: "Drops",
title: { text: "Drops" },
color : "red"
}
]
});
The datasource returns the following json
[
{
"BlueLabelId": 528,
"StreamInterfaceId": 16,
"Timestamp": "0001-01-01T00:00:00",
"StreamMode": "receiver",
"SourceAddress": null,
"SourcePort": 0,
"SinkAddress": null,
"SinkPort": 0,
"Drops": 66017,
"Bitrate": 0,
"BitrateIn": 0,
"BitrateOut": 0,
"ResendCounter": 0,
"RudPrtt": 0,
"PathName": null,
"LinkDrops": 0,
"PathNumber": 1,
"Year": null,
"Month": null,
"Day": null,
"Hour": null,
"Minute": null,
"Second": null,
"Tmax": null,
"Tunit": "2015 Jul 09",
"AvgBitRate": 0,
"AvgBitRateIn": 0,
"AvgBitRateOut": 0,
"SelGrp": "528/16/1/receiver",
"AvgBitRateInS": "0",
"AvgBitRateOutS": null,
"userColor": "#FF0000"
},
{
"BlueLabelId": 528,
"StreamInterfaceId": 16,
"Timestamp": "0001-01-01T00:00:00",
"StreamMode": "receiver",
"SourceAddress": null,
"SourcePort": 0,
"SinkAddress": null,
"SinkPort": 0,
"Drops": 0,
"Bitrate": 0,
"BitrateIn": 0,
"BitrateOut": 0,
"ResendCounter": 0,
"RudPrtt": 0,
"PathName": null,
"LinkDrops": 0,
"PathNumber": 100,
"Year": null,
"Month": null,
"Day": null,
"Hour": null,
"Minute": null,
"Second": null,
"Tmax": null,
"Tunit": "2015 Jul 09",
"AvgBitRate": 0,
"AvgBitRateIn": 0,
"AvgBitRateOut": 14289,
"SelGrp": "528/16/100/receiver",
"AvgBitRateInS": null,
"AvgBitRateOutS": "14289",
"userColor": "#FF0000"
},
{
"BlueLabelId": 528,
"StreamInterfaceId": 16,
"Timestamp": "0001-01-01T00:00:00",
"StreamMode": "receiver",
"SourceAddress": null,
"SourcePort": 0,
"SinkAddress": null,
"SinkPort": 0,
"Drops": 0.000001,
"Bitrate": 0,
"BitrateIn": 0,
"BitrateOut": 0,
"ResendCounter": 0,
"RudPrtt": 0,
"PathName": null,
"LinkDrops": 0,
"PathNumber": 1,
"Year": null,
"Month": null,
"Day": null,
"Hour": null,
"Minute": null,
"Second": null,
"Tmax": null,
"Tunit": "2015 Jul 10",
"AvgBitRate": 0,
"AvgBitRateIn": 15960,
"AvgBitRateOut": 0,
"SelGrp": "528/16/1/receiver",
"AvgBitRateInS": "15960",
"AvgBitRateOutS": null,
"userColor": "#FF0000"
},
{
"BlueLabelId": 528,
"StreamInterfaceId": 16,
"Timestamp": "0001-01-01T00:00:00",
"StreamMode": "receiver",
"SourceAddress": null,
"SourcePort": 0,
"SinkAddress": null,
"SinkPort": 0,
"Drops": 0,
"Bitrate": 0,
"BitrateIn": 0,
"BitrateOut": 0,
"ResendCounter": 0,
"RudPrtt": 0,
"PathName": null,
"LinkDrops": 0,
"PathNumber": 100,
"Year": null,
"Month": null,
"Day": null,
"Hour": null,
"Minute": null,
"Second": null,
"Tmax": null,
"Tunit": "2015 Jul 10",
"AvgBitRate": 0,
"AvgBitRateIn": 0,
"AvgBitRateOut": 14289,
"SelGrp": "528/16/100/receiver",
"AvgBitRateInS": null,
"AvgBitRateOutS": "14289",
"userColor": "#FF0000"
}
]
(Little info. The pathnumber 100 is a summary. It is not a selected item, but is used when showing BitRateIn for a transmitter and BitRateOut for a receiver - I am using AvgBitRateInS / AvfBitRateOutS so I can return a "null" which should hide the non relevant info. For "Drops" I am returning zero (0) in order to hide relevant data.)
For some reason I still get a legend as shown.
How can I make the non-necessary 528/16/receiver :AvgBitRate In and 528/16/receiver Drops NOT show in the legend?