-
DeasusSeptember 9, 2020 at 11:17 am #12004
Hello thank you!
I put
.style(‘background-color-top’, ‘#FFF’)
.style(‘background-color-bottom’, ‘#FFF’)In the body-tag under ‘viz’in the HTML page I created from scratch. Essentially the below. I think when people are starting out with limited experience they are trying to change style variable and wonder where (which file and where in which file) do these changes go.
Example is below (for anyone else looking at this, make sure you create the file in an editor of your choice and save it in the same directory as your other Vizuly test containers (things that say stuff like BarChartTest.html . etc. Take a look:
_____
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title>Deeps First Bar Chart</title>
<link rel=”stylesheet” href=”lib/styles/vizuly.css”><script src=”lib/d3_v5.7.min.js”></script>
<script src=”lib/vizuly2_core.min.js”></script>
<script src=”src/BarChart.js”></script></head>
<body>
<div id=”myDiv” style=”width:600px; height:600px; margin:0px auto;”></div>
<script id=”testscript”>var viz = vizuly2.viz.BarChart(“#myDiv”);
var data = [
[{‘stock’: ‘In Stock’, ‘fruit’ : ‘Apples’, ‘value’: 10,},{‘stock’: ‘In Stock’, ‘fruit’ : ‘Peaches’, ‘value’: 15},{‘stock’: ‘In Stock’, ‘fruit’ : ‘Pears’, ‘value’: 20}],
[{‘stock’: ‘Out Of Stock’, ‘fruit’ : ‘Apples’, ‘value’: 4,},{‘stock’: ‘Out Of Stock’, ‘fruit’ : ‘Peaches’, ‘value’: 8},{‘stock’: ‘Out Of Stock’, ‘fruit’ : ‘Pears’, ‘value’: 30}]
]viz
.data(data)
.width(‘100%’)
.height(‘100%’)
.x(function (d, i) { return Number(d.value); })
.y(function (d, i) { return d.fruit; })
.seriesLabel( function (d,i) { return d.stock })
.style(‘background-color-top’, ‘#FFF’)
.style(‘background-color-bottom’, ‘#FFF’)
.update();</script>
</body>
</html>You must be logged in to reply to this topic.
© 2024 — vizuly.io