Open xiaolin3303 opened 7 years ago
当数据量大的时候,线图的x轴就相当密集,是否可以像echarts/highCharts那样设置横轴的数据显示比例呢,让x轴不那么密集?
@javarcn 对于X轴很密集的情况工具会自动进行抽稀处理,如果还不能满足你的需求,关注下这个issue51
@xiaolin3303 自动抽稀的条件是?
@Galen-Yip X轴显示文案不发生碰撞
可以修改折线图转点处的颜色吗?比如:我在2016.6月有一个数据为空,按照目前的是不画折线图,但是,我的需求是,当数据为空时,我让折线处的颜色变成红色,而数值变成前后数值的算术平均数.请问这个可以实现吗?
那个柱状图的 柱子怎么弄成圆角柱子
请问柱状图怎么去掉x轴显示的文案
请问 柱形图之间的间距怎么修改
@wfq1095745112 暂时不支持圆角
@nanchaodong
opts.dataLabel
Boolean default true 是否在图表中显示数据内容值
opts.extra.column.width
Number 柱状图每项的图形宽度,单位为px
这些文档里面都有写
@xiaolin3303 请问,饼图的图例可以放到顶部或者左边或者右边吗?
@nanchaodong opts.dataLabel Boolean default true 是否在图表中显示数据内容值 opts.extra.column.width Number 柱状图每项的图形宽度,单位为px 这些文档里面都有写 我问的是柱子与柱子之间的距离 不是改柱子的宽度 我发现调完柱子的宽度 并没有改变距离
微信小程序布局中有雷达环形柱状图 这些图标的位置都不固定 页面上乱排布 为什么?
@nanchaodong
微信小程序布局中有雷达环形柱状图 这些图标的位置都不固定 页面上乱排布 为什么?
这个问题请单独开一个issue,并附上更多的信息(截图,关键代码等)
请问区域图中,我想将每个数据拐点那里的菱形,换成圆形,有字段选项设置吗
X 轴目前还不支持指定 fontsize 和是否倾斜显示是吧?
ring chart中颜色怎么设置呢
series: [{ name: "已完成", color:"#ffba00", data: 2, }, { name:"未完成", data: item.totalSignInTimes - 2, }],
ring chart怎么使得圆环的起点是正上方,而不是右边呢 extra:{ pie:{ offsetAngle:-90 } },
这个和swiper组件一起使用的时候, 绘画出的canvas图像 不随屏幕滑动一起移动,就感觉像是被固定定位了, 请问你们有遇到这个问题吗? (在微信开发者工具里 是正常的 但是手机上就会出现这个问题, 安卓,IOS 都有这个问题.)
加入了等分的白色分割线
配置:
drawWhiteLine:true,
whiteLineCount:10
链接:https://github.com/MobileGo2015/wx-charts
完整代码: var drawProgress =function(that){ for(var index=0;index<that.data.list.length;index++){ var item = that.data.list[index]; var signInTimes = item.hasSignInTimes; var unSignInTimes = item.totalSignInTimes - item.hasSignInTimes; var signInColor = "#ffba00"; var unSignInColor ="#f4f4f4"; if (unSignInTimes < 0){ signInColor ="#ff7e00"; unSignInColor ="#ffba00"; } new wxCharts({ canvasId: "wxChartCanvas"+item.timeStamp+""+item.activityId, type: 'ring', series: [{ name: "已完成", data: signInTimes, color: signInColor }, { name:"未完成", data: unSignInTimes, color: unSignInColor }], extra:{ pie:{ offsetAngle:-90 }, ringWidth:12 }, title: { name: (100 * signInTimes / item.totalSignInTimes).toFixed(1)+'%', color:'#999999', fontSize:15 }, width: 136, height: 136, dataLabel: false, legend:false, disablePieStroke:true, drawWhiteLine:true, whiteLineCount:10 }); }; }
这个和swiper组件一起使用的时候, 绘画出的canvas图像 不随屏幕滑动一起移动,就感觉像是被固定定位了, 请问你们有遇到这个问题吗? (在微信开发者工具里 是正常的 但是手机上就会出现这个问题, 安卓,IOS 都有这个问题.),,我也遇到这个问题
@liuyon7 我也遇到跟你一样的问题了,兄弟解决了吗?
@liuyon7 参考#141
@boreyic 参考 #141
line类型中,请问怎么样不显示x轴的数据, 然后怎么改变数据点的的形状,请大神解答!!!
x轴 字体怎么能水平显示, 现在是倾斜显示的
@boreyic 我改用定时器,自己刷新数据了
@yang-xd x轴文案如果会发生碰撞就会自动倾斜显示
在Y轴设置最大最小值,不管用,数据中也没有超过y轴最大值的数据。例如,y轴上要显示1-12月份 为什么这个hans函数返回的值不是很正确?如何正确的设置?
@1294694985 y轴目前固定是5个刻度,min, max只是制定Y轴的数据范围
怎么实现多柱状图的情况 每个柱的颜色怎么调呢
分割线的颜色怎么调呢
在柱状图中,能不能把每个柱根据数据大小设置不同颜色?
雷达图默认是三圈,怎么设置圈数呀,项目要求有5圈
@lwoshishenya 在wxcharts.js中config中有一个参数radarGridCount:3,改成5就可以
请问如何让刻度文字居中
饼图下方的类别图例太多,右边文字超出屏幕,看不到了。这个有什么参数可以设置吗?
请问纵坐标的刻度 可否加一个自定义刻度
话说,这个文档是不是没写全啊?总感觉demo图表里的参数,不止上面文档里描述的。
项目有很多数据,想请问下怎么实现柱状图横向排列呢?
请问ring的坐标怎么改啊
请问怎么让文字变斜显示,或则竖直显示?谢谢
@DaDongCode 字体倾斜可以使用样式font-style:italic或者是font-style:oblique设置。竖直显示可以将标签宽度设置小些
@houwh001 是在canvas上面画出来的文字,就像这个插件的Line和Scrollline的横轴文字那样变斜,使用ctx.fillText()
您好,请问一下Scrollline中的统计图可以滑动的方法是什么? @xiaolin3303
没找到tonyiweb 的扩展版本。急用将就先搞了一个。 文件发不上来,源代码: //eric:2018-1-1 扩展Pie图支持drawWhiteLine 画10个间隔白灰等块 function getPieDataPoints(series, process, opts) { var process = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var count = 0;
var _start_ = opts.drawWhiteLine == true ? 2 * 0.1 * 0.10 * Math.PI : 0;
series.forEach(function (item) {
item.data = item.data === null ? 0 : item.data;
count += item.data;
});
series.forEach(function (item) {
item.data = item.data === null ? 0 : item.data;
item._proportion_ = item.data / count * process;
});
series.forEach(function (item) {
item._start_ = _start_;
_start_ += 2 * item._proportion_ * Math.PI;
});
return series;
} //eric:2018-1-1 扩展drawWhiteLine属性,画出渐格圈------------- var xx1=[]; var xx2 = []; if (opts.drawWhiteLine==true) { series.pop(); //默认移除最后一个serie,最后一个为未完成item var start = -90 - 2 0.1 0.15 Math.PI; for (var i = 0, len = 10; i < len; i++) { var yy = {}; yy.color = "#dbdbdb"; yy.start = start; yy.proportion = 0.10.85; start += 2 yy.proportion Math.PI; series.unshift(yy);
var zz = {};
zz.color = "white";
zz._start_ = _start_;
zz._proportion_ = 0.1*0.15;
_start_ += 2 * zz._proportion_ * Math.PI;
series.push(zz);
}
}
//-------------
series.forEach(function (eachSeries) {
context.beginPath();
context.setLineWidth(2);
context.setStrokeStyle('#ffffff');
context.setFillStyle(eachSeries.color);
提供个思路参考。。。
请问areaChart中如何加竖线,绘制成网格形状?在线等!
opts.legend 设置为true 不管用。
legend 点击事件 是哪个?
canvas 宽高没问题 但是里面的圆环非常小是为什么?不应该适应canvas大小吗?
参数说明
opts
Objectopts.canvasId
String required 微信小程序canvas-idopts.width
Number required canvas宽度,单位为pxopts.height
Number required canvas高度,单位为pxopts.background
String canvas背景颜色(如果页面背景颜色不是白色请设置为页面的背景颜色,默认#ffffff
)opts.enableScroll
Boolean 是否开启图表可拖拽滚动 默认false
支持line
,area
图表类型(需配合绑定scrollStart
,scroll
,scrollEnd
方法)opts.title
Object (only for ring chart)opts.title.name
String 标题内容opts.title.fontSize
Number 标题字体大小(可选,单位为px)opts.title.color
String 标题颜色(可选)opts.title.offsetX
Number 标题横向位置偏移量,单位px,默认0opts.subtitle
Object (only for ring chart)opts.subtitle.name
String 副标题内容opts.subtitle.offsetX
Number 副标题横向位置偏移量,单位px,默认0opts.subtitle.fontSize
Number 副标题字体大小(可选,单位为px)opts.subtitle.color
String 副标题颜色(可选)opts.animation
Boolean defaulttrue
是否动画展示opts.legend
Boolen defaulttrue
是否显示图表下方各类别的标识opts.type
String required 图表类型,可选值为pie
,line
,column
,area
,ring
,radar
opts.categories
Array required (饼图、圆环图不需要) 数据类别分类opts.dataLabel
Boolean defaulttrue
是否在图表中显示数据内容值opts.dataPointShape
Boolean defaulttrue
是否在图表中显示数据点图形标识opts.disablePieStroke
Boolean defaultfalse
不绘制饼图(圆环图)各区块的白色分割线opts.xAxis
Object X轴配置opts.xAxis.gridColor
String 例如#7cb5ec
default#cccccc
X轴网格颜色opts.xAxis.fontColor
String 例如#7cb5ec
default#666666
X轴数据点颜色opts.xAxis.disableGrid
Boolean defaultfalse
不绘制X轴网格opts.xAxis.type
String 可选值calibration(刻度)
默认为包含样式opts.yAxis
Object Y轴配置opts.yAxis.format
Function 自定义Y轴文案显示opts.yAxis.min
Number Y轴起始值opts.yAxis.max
Number Y轴终止值opts.yAxis.title
String Y轴titleopts.yAxis.gridColor
String 例如#7cb5ec
default#cccccc
Y轴网格颜色opts.yAxis.fontColor
String 例如#7cb5ec
default#666666
Y轴数据点颜色opts.yAxis.titleFontColor
String 例如#7cb5ec
default#333333
Y轴title颜色opts.yAxis.disabled
Boolean defaultfalse
不绘制Y轴opts.extra
Object 其他非通用配置项opts.extra.ringWidth
NumberringChart
圆环宽度,单位为px
opts.extra.lineStyle
String (仅对line
,area
图表有效) 可选值:curve
曲线,straight
直线 (default)opts.extra.column
Object 柱状图相关配置opts.extra.column.width
Number 柱状图每项的图形宽度,单位为px
opts.extra.legendTextColor
String 例如#7cb5ec
default#cccccc
legend文案颜色opts.extra.radar
Object 雷达图相关配置opts.extra.radar.max
Number, 默认为series data
的最大值,数据区间最大值,用于调整数据显示的比例opts.extra.radar.labelColor
String, 默认为#666666
, 各项标识文案的颜色opts.extra.radar.gridColor
String, 默认为#cccccc
, 雷达图网格颜色opts.extra.pie
Object 饼图、圆环图相关配置opts.extra.pie.offsetAngle
Number, 默认为0
, 起始角度偏移度数,顺时针方向,起点为3点钟位置(比如要设置起点为12点钟位置,即逆时针偏移90度,传入-90即可)opts.series
Array required 数据列表数据列表每项结构定义
dataItem
ObjectdataItem.data
Array required (饼图、圆环图为Number) 数据,如果传入null
图表该处出现断点dataItem.color
String 例如#7cb5ec
不传入则使用系统默认配色方案dataItem.name
String 数据名称dateItem.format
Function 自定义显示数据内容