Echarts可视化教程

  1. 网站首页
  2. 百度ECharts
  3. ECharts实例
  4. ECharts入门
  5. 地图大全
  6. ECharts官网

利用Frappe Charts框架搭建图表

//安装 Frappe Charts
$ npm install frappe-charts

//在项目中引入并初始化
import { Chart } from "frappe-charts"

const data = {
  labels: ["周一", "周二", "周三", "周四","周五", "周六", "周日"],
  datasets: [
    {
      name: "用户注册数", chartType: "bar",
      values: [250, 400, 300, 350, 800, 520, 170]
    },
    {
      name: "订单量", chartType: "line",
      values: [2500, 5000, 3100, 1589, 1823, 3245, 2787]
    }
  ]
}

// 支持选择器或直接传入 DOM element 对象
const chart = new Chart("#chart", {  
  title: "图表名称",
  data: data,
  type: 'axis-mixed', // 指定图表类型为混合型
  height: 250,
  colors: ['#7cd6fd', '#743ee2'] // 定义图例颜色
})
点击展开全文

相关文章

  1. 在线直接引入js库Frappe Charts图表库搭建示例