- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我使用 extjs 图表系列绘制了一个圆形仪表。我想将仪表的值指示到它的中间,但我没有成功。有没有人可以帮助我?
这是我试过的代码:
{
xtype: 'polar',
width: 60,
height: 60,
background: '#00c6c9',
style: {left:0, right:0},
series: {
type: 'gauge',
minimum: 0,
maximum: 30,
value: 10,
colors: ['#25a2b6', 'lightgrey'],
donut: 75,
background: '#00c6c9',
totalAngle: Math.PI * 2,
style: {left:0, right:0},
needleLength: 100
/*,
renderer: function(sprite, record, attributes, index, store) {
var sprite2 = Ext.create('Ext.draw.Sprite', {
type: 'text',
text: Math.floor(attributes.value),
font: '16px Arial',
x: 30,
y: 30
});
sprite2.show(true);
return attributes;
},
label: {
field: 'value',
display: 'middle'
}*/
}
}
我只想显示该系列的值“10”。在评论中你可以看到我试图添加一个渲染器函数和一个标签属性。在这个标签中,我想我不能写“field:'value'”但是因为我不需要定义一个字段我不知道该用什么。
非常感谢
最佳答案
这是解决方案,您可以在图表的渲染功能上更改您的 Sprite ,然后重绘它,更改 x、y、值和其他东西
Ext.create({
xtype: 'polar',
renderTo: document.body,
width: 160,
height: 160,
background: '#00c6c9',
style: {
left: 0,
right: 0
},
listeners:{
render: function(chart){
var sprite=Ext.clone(chart.getSprites()[0]);
//modify sprite here
sprite.text=''+chart.getSeries()[0].config.value;
chart.setSprites(sprite);
chart.redraw();
}
},
sprites: [{
type: 'text',
x: 58,
y: 95,
text: 'test',
fontSize: 40,
fillStyle: 'white'
}],
series: {
type: 'gauge',
minimum: 0,
maximum: 30,
value: 10,
colors: ['#25a2b6', 'lightgrey'],
donut: 75,
background: '#00c6c9',
totalAngle: Math.PI * 2,
style: {
left: 0,
right: 0
},
needleLength: 100
}
});
关于javascript - 使用 Extjs 在圆形仪表图中间添加图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39830802/
我是 ASM(字节码操作工具包)的新手,正在使用它来检测 Java 字节码。我想访问类的方法并使用 ASM 更改它们的访问修饰符。有人知道如何实现这一目标吗?我知道调用 visitMethod 会有所
如何使用 Instrumentation 从 TestCase 中控制 Android Activity 的生命周期? 关于 official documentation ,声明为“生命周期控制:使用
我正在尝试构建类似于以下内容的 SVG: 笔画是完全动态的,因为它们来自 API。我想将笔画放在收到的点上(作为百分比值数组)。不必有序且两笔之间的距离不必相等 我正在尝试类似下面的方法,但无法提出笔
我正在使用基于 (Chartjs-tsgauge) 的仪表图表。 我想为图表设置与仪表限制分开的背景颜色。如何的问题图表.JS 渲染背景,因为我使用的插件没有关于背景的代码。 例如,我有一个有限制的仪
我有一个来自 logstash 的数据,它显示了数据库中的表使用了多少空间以及表的最大分配容量。我想在 Kibana 中为每个表创建显示当前占用多少空间的仪表。 问题是最大可用空间有时会发生变化,因此
我正在使用 HighChart 的 Angular Gauge,想知道是否可以有不等的间隔。目前,Y 轴上的不等间隔会影响仪表中每个绘图带的大小。如何才能在 Y 轴上具有相等的绘图带大小和不等间隔。
我是 HighCharts 的新手。 我有一个问题,当页面上有多个仪表时,第一个仪表会消失。 这个例子工作正常: HighChart test
我正在尝试使用一些现成的 javascript 来制作仪表。我快到了,但我不知道如何管理值(value)标题。 现在我的代码是这样工作的: 这就是我喜欢它的工作方式: 不知道如何解决问题。使用 Mat
我需要创建一个如下图所示的仪表。 我尝试使用JustGage为了做到这一点,但我找不到渲染仪表下部的方法(图像中的红色半圆)。 我想使用 JustGage。有人知道如何使用 JustGage 绘制“镜
我正在尝试在页面上插入多个 Google 仪表(或 Highchart 仪表)实例。 我想使用不同的选项集并将它们分开。所以我不能使用这里介绍的解决方案,我认为:Google Charts multi
我正在创建一个单页仪表板,它将在我想显示一些图表的监视器上全屏运行。我已经制作了图表,现在我只需要一个合适的页面模板。我在想这样的事情 我真的很喜欢它的外观,但我对如何使用大概的 css/js 制作这
我正在尝试编写一个应用程序,它从加速度计中获取值并通过条形仪表(或者可能是针规)显示它们,但我不确定如何让仪表工作。我正在考虑这些选择: 将仪表分成多个部分,因此仪表“填满”的多个图像,并根据加速度计
我正在尝试使用 Modbus 协议(protocol)对 Socomec 仪表执行 ping 操作,经过研究,我发现了 NModbus,这是一个 C# 库。我之前从未使用过库或 C#(通常是 Java
是否可以将 flexdashboard(下图)中的仪表嵌入 Shiny 应用程序(shinydashboard 或 shiny) >)? 来自 flexdashboard 的 Shiny flexda
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我尝试向我的网站添加仪表,我将 js 和 css 添加到我的信息文件 比在页面中我有这段代码 $(document).ready(function(){ s1 = [1]; plo
我正在尝试在数据标签中添加图标,我成功地添加了一些像这样的 HTML return 'Partially rejected: ' + partial + '' +'Rejected: ' + reje
我发现了一些像 VU 表一样移动指针的 CSS。这模仿了我想做的事情。然而,它从头到尾做一个完整的动画。而我想通过一系列的点击来实现改变。我试图弄清楚如何做到这一点,但我没有成功。我想知道如何让针只通
我在 D3 或 C3js 中寻找这样的东西: C3 中的默认 Gauge Chart 将多个列作为数据,但随后将它们显示在同一行上,因此它们相互覆盖。 最佳答案 如果您使用的是 Angular 4,则
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我是一名优秀的程序员,十分优秀!