forked from alwayslove2013/ZChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (23 loc) · 670 Bytes
/
Copy pathindex.js
File metadata and controls
25 lines (23 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import ZChart from "./js/index.js";
import barChartConfig from "./barChartConfig.js";
import scatterPlotConfig from "./scatterPlotConfig.js";
import * as d3 from "d3";
window.addEventListener("DOMContentLoaded", async () => {
const dataFile = "./data/data.json";
const data = await fetch(dataFile).then((res) => res.json());
const csvFile = "./data/test.csv";
const data1 = await d3.csv(csvFile);
console.log(data1);
ZChart({
chartType: "scatter_plot",
domSelector: "#container-1",
data,
config: scatterPlotConfig,
});
ZChart({
chartType: "barchart",
domSelector: "#container-2",
data,
config: barChartConfig,
});
});