mirror of https://github.com/Budibase/budibase.git
4 changed files with 130 additions and 55 deletions
@ -0,0 +1,73 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>Document</title> |
|||
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-selection/1.2.0/d3-selection.js"></script> |
|||
<script src="https://cdn.jsdelivr.net/npm/britecharts@2.10.0/dist/umd/bar.min.js" |
|||
type="text/javascript"></script> |
|||
|
|||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/britecharts/dist/css/britecharts.min.css" type="text/css" /> |
|||
|
|||
</head> |
|||
<body> |
|||
|
|||
<article> |
|||
<h2 class="tutorial__heading">Bar Chart</h2> |
|||
<div class="bar-chart"></div> |
|||
</article> |
|||
|
|||
<script> |
|||
|
|||
const dataset = [ |
|||
{ |
|||
"name": "Radiating", |
|||
"value": 2 |
|||
}, |
|||
{ |
|||
"name": "Opalescent", |
|||
"value": 4 |
|||
}, |
|||
{ |
|||
"name": "Shining", |
|||
"value": 3 |
|||
}, |
|||
{ |
|||
"name": "Vibrant", |
|||
"value": 6 |
|||
}, |
|||
{ |
|||
"name": "Vivid", |
|||
"value": 6 |
|||
}, |
|||
{ |
|||
"name": "Brilliant", |
|||
"value": 1 |
|||
} |
|||
] |
|||
|
|||
const barContainer = d3.select('.bar-chart'); |
|||
|
|||
const barChart = britecharts.bar() |
|||
|
|||
barChart |
|||
.width(700) |
|||
.height(300) |
|||
.enableLabels(true) |
|||
.labelsNumberFormat('.0%') |
|||
.isAnimated(true) |
|||
.yAxisLabel("Quantity") |
|||
.xAxisLabel("Color") |
|||
.betweenBarsPadding("0.8") |
|||
|
|||
// .on('customMouseOver', tooltip.show) |
|||
// .on('customMouseMove', tooltip.update) |
|||
// .on('customMouseOut', tooltip.hide); |
|||
|
|||
barContainer.datum(dataset).call(barChart); |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
|||
Loading…
Reference in new issue