DataD
Data Dashboard(数据仪表板)
使用方式:
1、安装:npm install https://github.com/yangjijiang/DataD.git
2、引用/调用(跟具自己具体情况进行调整):
a)将DataD中dist目录下的内容复制到自己的工程目录中(webpack.config.js中配置)
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
...,
...,
plugins: [
new CopyPlugin([
{ from: path.join(__dirname, './node_modules/DataD/dist'), to: path.join(__dirname, '../dist/DataD') }
])
]
}
b)通过自己项目的路由跳转,调用自己项目下/dist/DataD/index.html
功能介绍:
1、数据URL请求的三种策略(Default,Jsonp,Proxy)
1.1、如果您将DataD嵌入到自己的项目做了一个功能使用时:
a)Default(默认内部域名访问)
图表的数据URL可以如下形式填写( /dashboard/data 等)
b)Jsonp(跨域名访问)--- JSOP回调函数:jsonpCallback
后台Controller方法返回值需要做进一步处理 ( return "jsonpCallback("&