Mam wykres Sankey'a. Ma 2 sekcje - Warzywa i Frutis. Nie chcę macek do Warzyw.Problem z listą Google wykresu Sankey'a
Czy to możliwe?
Oto zrzut ekranu:
To jest mój aktualny kod na wykresie Sankey:
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<style>
.my-padding {
margin-top: 50px;
margin-bottom: 50px;
margin-right:50px;
}
</style>
<script type="text/javascript">
google.charts.load('current', {'packages':['sankey']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'From');
data.addColumn('string', 'To');
data.addColumn('number', 'Weight');
data.addRows([
[ 'Vegetables 70.2%',, 70.2],
[ 'Fruits 29.8%', 'Orange 9%', 9 ],
[ 'Fruits 29.8%', 'Apple 8.6%', 8.6 ],
[ 'Fruits 29.8%', 'Banana 7.9%', 7.9 ],
[ 'Fruits 29.8%', 'Grapes 4.3%', 4.3 ],
[ 'Orange 9%', 'Apple 4.0%', 4.0 ],
[ 'Orange 9%', 'Banana 3.2%', 3.2 ],
[ 'Orange 9%', 'Grapes 1.7%', 1.7 ],
[ 'Apple 8.6%', 'Orange 4.8%', 4.8 ],
[ 'Apple 8.6%', 'Banana 2.0%', 2.0 ],
[ 'Apple 8.6%', 'Grapes 1.8%', 1.8 ],
[ 'Banana 7.9%', 'Orange 3.4%', 3.4 ],
[ 'Banana 7.9%', 'Apple 2.9%', 2.9 ],
[ 'Banana 7.9%', 'Grapes 2.4%', 1.7 ],
[ 'Grapes 4.3%', 'Orange 1.6%', 1.6 ],
[ 'Grapes 4.3%', 'Banana 1.4%', 1.4 ],
[ 'Grapes 4.3%', 'Apple 1.3%', 1.3 ],
]);
// Sets chart options.
var options = {
width: 1000,
height:600,
sankey: {
node: {
label: {
fontName: 'sans-serif',
fontSize: 17,
color: '#000',
bold: true,
italic: false
},
interactivity: true, // Allows you to select nodes.
labelPadding: 10, // Horizontal distance between the label and the node.
nodePadding: 10, // Vertical distance between nodes.
}
}
};
// Instantiates and draws our chart, passing in some options.
var chart = new google.visualization.Sankey(document.getElementById('sankey_basic'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div class="container">
<div class="row" >
<div class="col-md-6 my-padding">
<div id="sankey_basic" ></div>
</div>
</div>
</div>
</body>
</html>
Czy możesz dokładnie wyjaśnić, czego dokładnie chcesz? Nie widzę żadnych macek w próbce. – Guenther
@Guenther - dodano zrzut ekranu. – dang