mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 03:33:19 +08:00

* chore: eslint flat config * chore: format * update according to review * chore: remove prettier config and format * fix: move handler to script to bypass eslint * chore: config eslint for lang=js block * docs: add surrounding empty lines for code block * chore: also minify css in csp build * chore: publint
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
function random() {
|
|
return Math.round(300 + Math.random() * 700) / 10;
|
|
}
|
|
|
|
export default function getData() {
|
|
return {
|
|
textStyle: {
|
|
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif',
|
|
fontWeight: 300,
|
|
},
|
|
dataset: {
|
|
dimensions: ["Product", "2015", "2016", "2017"],
|
|
source: [
|
|
{
|
|
Product: "Matcha Latte",
|
|
2015: random(),
|
|
2016: random(),
|
|
2017: random(),
|
|
},
|
|
{
|
|
Product: "Milk Tea",
|
|
2015: random(),
|
|
2016: random(),
|
|
2017: random(),
|
|
},
|
|
{
|
|
Product: "Cheese Cocoa",
|
|
2015: random(),
|
|
2016: random(),
|
|
2017: random(),
|
|
},
|
|
{
|
|
Product: "Walnut Brownie",
|
|
2015: random(),
|
|
2016: random(),
|
|
2017: random(),
|
|
},
|
|
],
|
|
},
|
|
xAxis: { type: "category" },
|
|
yAxis: {},
|
|
// Declare several bar series, each will be mapped
|
|
// to a column of dataset.source by default.
|
|
series: [{ type: "bar" }, { type: "bar" }, { type: "bar" }],
|
|
};
|
|
}
|