1. 首页 > 新知识

echarts教学视频(echarts快速上手)

echarts的xAxis类型模式怎么设置宽度

控制echarts柱子的最大宽度方法:选柱间距离(默认为柱形宽度的30%),可设固定值 barCategoryGap : ’20’等。ECharts简介:ECharts,缩写来自Enterprise Charts,商业级数据图表,一个纯Javascript的图表库,可以流畅的运行在PC和移动设备上,兼容当前绝大部分浏览器(IE6/7/8/9/10/11,chrome,firefox,Safari等),底层依赖轻量级的Canvas类库ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。创新的拖拽重计算、数据视图、值域漫游等特性大大增强了用户体验,赋予了用户对数据进行挖掘、整合的能力。

如何用java整合echarts生成饼图

首先要把echarts所需的js和swf文件导入进去//后台拼图标所需xml

StringBufferoutXml=newStringBuffer();//任务列表xml字符串

@Action(“/task/loadMyTaskPercentXml”)

publicStringloadMyTaskPercentXml()

{

HttpServletResponseres=ServletActionContext.getResponse();

res.setHeader(“Cache-Control”,”no-store”);

res.setHeader(“Pragma”,”no-cache”);

res.setDateHeader(“Expires”,0);

res.setContentType(“text/xml;charset=GBK”);

PrintWriterout=res.getWriter();

StringBufferoutXml=newStringBuffer(

” \n”);

outXml

.append(““);

outXml.append(“\n”);

outXml.append(“

outXml.append(“\’value=\'”+s1.replace(“%”,””)+””);

outXml.append(“\’/>”);

outXml.append(“\n”);

outXml.append(“

outXml.append(“\’value=\'”+s2.replace(“%”,””)+””);

outXml.append(“\’/>”);

outXml.append(“\n”);

outXml.append(“\n”);

out.print(outXml.toString());

out.flush();

out.close();

returnnull;

}

在后台进行拼装xml,并且返回到页面

${outXml}

vartext=document.getElementById(“taskListGraph”).innerHTML

varchart2=newFusionCharts(“${base}/swf/Bar2D.swf?ChartNoDataText=暂无数据&XMLLoadingText=正在载入数据,请稍候”,”chart02″,”610″,”276″);

chart2.setDataXML(text);

chart2.render(‘jdbox’);

chart2.addParam(“wmode”,”Opaque”);

这样图就生成好了!

ECharts

我查了下,ECharts是百度开发的开源代码,托管到了GitHub上,协议是:

Copyright (c) 2013, Baidu Inc.

All rights reserved.

Redistribution and use of this software in source and binary forms, with or

without modification, are permitted provided that the following conditions

are met:

Redistributions of source code must retain the above copyright notice, this

list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation

and/or other materials provided with the distribution.

Neither the name of Baidu Inc. nor the names of its contributors may be used

to endorse or promote products derived from this software without specific

prior written permission of Baidu Inc.

看着说是免费的,但是得加上它的声明,也就是加上这个协议.

echarts

1、首先打开百度echarts官网,并打开页面。

2、然后根据自己需要选择一个图形,这里选择柱状图导入到页面。

3、然后打开上方导航的文档>参考手册,从文档中可以看出,如果需要改变坐标轴的文本颜色,需要在axis中添加axisLabel属性,并在其中嵌套textStyle属性,然后设置color。

4、打开实例界面,编辑左侧代码,添加如图代码,其中颜色设置为自己想要的颜色即可。

5、点击右侧界面刷新按钮,可以看到y轴坐标标题变成了设置的颜色。

本文由本站作者发布,不代表新营销立场,转载联系作者并注明出处:https://www.newmarketingcn.com/xinzhishi/746185.html

留言与评论(共有 0 条评论)
   
验证码: