图表上传服务器显示不了,请教一个服务器端调用echarts显示图表问题

[aardio] 纯文本查看 复制代码

if( !request ){

/*

创建一个兼容FastCGI接口的简单Web服务器,如果已经在Web服务器环境下这段可以省略。

*/

import fsys.log;

import wsock.tcp.simpleHttpServer;

import process;

import console;

global.onError = function( err,over ){

if(!over){

import debug;

var stack = debug.traceback(,"调用栈",3);

err = ..string.concat(err,'\n',stack);

}

fsys.log.print( err );

}

var server = wsock.tcp.simpleHttpServer("127.0.0.1",/*8081*/);

console.setTitle("web服务器已启动 " + server.getUrl() );

process.execute( server.getUrl() )

server.run(

function(response,request){

response.loadcode( request.path ); //参数可以省略

}

);

return;

}

import web.json;

import web.script;

external = {

getOption = function( num ){

var data = {

calculable = true;

legend = {

data = { "直接访问"; "邮件营销"; "联盟广告"; "视频广告"; "搜索引擎" };

orient = "vertical";

x = "left"

};

series = {

{

center = { "50%"; "60%" };

data = {

{ name = "直接访问"; value = 335 };

{ name = "邮件营销"; value = 310 };

{ name = "联盟广告"; value = 234 };

{ name = "视频广告"; value = 135 };

{ name = "搜索引擎"; value = 1548 }

};

name = "访问来源"; radius = "55%"; type = "pie"

}

};

title = { subtext = "纯属虚构"; text = "某站点用户访问来源"; x = "center" };

toolbox = {

feature = {

dataView = { readOnly = false; show = true };

magicType = {

option = { funnel = { funnelAlign = "left"; max = 1548; width = "50%"; x = "25%" }};

show = true;

type = { "pie"; "funnel" }

};

mark = { show = true };

restore = { show = true };

saveAsImage = { show = true }

}; show = true

};

tooltip = { formatter = "{a}
{b} : {c} ({d}%)"; trigger = "item" }

}

var json = web.json.stringify(data);

return web.script.eval( "(" + json + ")" )

}

}

?>

var myChart = echarts.init(document.getElementById('main'));

myChart.setOption( external.getOption() );

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 1024 设计师:白松林 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值