EChartsConvert: 使用PhantomJS在服务端生成ECharts图片
因为业务需要用到 echarts 的 formatter 处理函数,
因此 options 可能不是json,可以通过eval函数声明options
修改java 请求服务参数,按post 请求方式,请求参数使用 text 文本形式。
private static String post(String url, Map<String, String> map, String encoding) throws ParseException, IOException {
String body = "";
// 创建httpclient对象
CloseableHttpClient client = HttpClients.createDefault();
// 创建post方式请求对象
HttpPost httpPost = new HttpPost(url);
// 装填参数
// List<NameValuePair> nvps = new ArrayList<>();
// if (map != null) {
// for (Map.Entry<String, String> entry : map.entrySet()) {
// nvps.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
//