答案 0 :(得分:0)
与图表中的大多数对象一样,每个节点都有show
和hide
方法,可用于切换其外观。和弦图将每个节点存储在Dictionary
中,因此您将要使用getKey
通过其名称访问该节点,然后调用openssl x509 -in client.crt -text -noout
:
hide
理想情况下,您希望在节点字典完全填充后调用此函数,例如在chart.nodes.getKey('Senica').hide()
事件期间。
datavalidated
演示:
chart.events.on('datavalidated', function() {
chart.nodes.getKey('Senica').hide()
})
am4core.useTheme(am4themes_animated);
var chart = am4core.create("chartdiv", am4charts.ChordDiagram);
chart.hiddenState.properties.opacity = 0;
chart.data = [
{ from: "A", to: "D", value: 10 },
{ from: "B", to: "D", value: 8 },
{ from: "B", to: "E", value: 4 },
{ from: "B", to: "C", value: 2 },
{ from: "C", to: "E", value: 14 },
{ from: "E", to: "D", value: 8 },
{ from: "C", to: "A", value: 4 },
{ from: "G", to: "A", value: 7 },
{ from: "D", to: "B", value: 1 }
];
chart.dataFields.fromName = "from";
chart.dataFields.toName = "to";
chart.dataFields.value = "value";
// make nodes draggable
var nodeTemplate = chart.nodes.template;
nodeTemplate.readerTitle = "Click to show/hide or drag to rearrange";
nodeTemplate.showSystemTooltip = true;
nodeTemplate.cursorOverStyle = am4core.MouseCursorStyle.pointer
chart.events.on('datavalidated', function() {
chart.nodes.getKey('A').hide();
chart.nodes.getKey('B').hide();
chart.nodes.getKey('D').hide();
})
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 100%;
height: 500px;
}