提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|使用教程|编辑:龚雪|2014-09-10 09:59:23.000|阅读 1286 次
概述:本文为amCharts使用任意文本替代标签教程。amcharts的ValueAxis中有一个属性叫labelFunction。在展现标签之前如果为该属性设置一些功能,将会呼出该功能、传递值、格式化值以及数值轴参考作为参数,该功能将会返回代替原来默认值的字符串。
# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>
尽管你可以像格式化时长一样格式化值轴标签,在值的左右添加单元。不过,你可能需要更多的功能,比如,用字符串代替值的数值轴,或者为分类轴标签添加文本。
amcharts的ValueAxis中有一个属性叫labelFunction。在展现标签之前如果为该属性设置一些功能,将会呼出该功能、传递值、格式化值以及数值轴参考作为参数,该功能将会返回代替原来默认值的字符串。
<img class="img-thumbnail alt=" amcharts="" 用任意文本替代标签"="" data-cke-saved-src="//image.pclwef.cn/images/article/2014/amcharts_Replacing_axis_labels_with_arbitrary_text_.jpg" src="//image.pclwef.cn/images/article/2014/amcharts_Replacing_axis_labels_with_arbitrary_text_.jpg">
var chart; var chartData = [ { "category": "Evaluation", "excelent": 20, "good": 20, "average": 20, "poor": 20, "bad": 20, "limit": 78, "full": 100, "bullet": 65 } ]; AmCharts.ready(function () { // FIRST BULLET CHART // bullet chart is a simple serial chart chart = new AmCharts.AmSerialChart(); chart.dataProvider = chartData; chart.categoryField = "category"; chart.rotate = true; // if you want vertical bullet chart, set rotate to false chart.columnWidth = 1; chart.startDuration = 1; // AXES // category var categoryAxis = chart.categoryAxis; categoryAxis.gridAlpha = 0; // value var valueAxis = new AmCharts.ValueAxis(); valueAxis.labelFunction = formatValue; valueAxis.maximum = 100; valueAxis.axisAlpha = 1; valueAxis.gridAlpha = 0; valueAxis.stackType = "regular"; // we use stacked graphs to make color fills chart.addValueAxis(valueAxis); // this graph displays the short dash, which usually indicates maximum value reached. var graph = new AmCharts.AmGraph(); graph.valueField = "limit"; graph.lineColor = "#000000"; // it's a step line with no risers graph.type = "step"; graph.noStepRisers = true; graph.lineAlpha = 1; graph.lineThickness = 3; graph.columnWidth = 0.5; // change this if you want wider dash graph.stackable = false; // this graph shouldn't be stacked chart.addGraph(graph); // The following graphs produce color bands graph = new AmCharts.AmGraph(); graph.valueField = "excelent"; graph.lineColor = "#19d228"; graph.showBalloon = false; graph.type = "column"; graph.fillAlphas = 0.8; chart.addGraph(graph); graph = new AmCharts.AmGraph(); graph.valueField = "good"; graph.lineColor = "#b4dd1e"; graph.showBalloon = false; graph.type = "column"; graph.fillAlphas = 0.8; chart.addGraph(graph); graph = new AmCharts.AmGraph(); graph.valueField = "average"; graph.lineColor = "#f4fb16"; graph.showBalloon = false; graph.type = "column"; graph.fillAlphas = 0.8; chart.addGraph(graph); graph = new AmCharts.AmGraph(); graph.valueField = "poor"; graph.lineColor = "#f6d32b"; graph.showBalloon = false; graph.type = "column"; graph.fillAlphas = 0.8; chart.addGraph(graph); graph = new AmCharts.AmGraph(); graph.valueField = "bad"; graph.lineColor = "#fb7116"; graph.showBalloon = false; graph.type = "column"; graph.fillAlphas = 0.8; chart.addGraph(graph); // this is the "bullet" graph - black bar showing current value graph = new AmCharts.AmGraph(); graph.valueField = "bullet"; graph.lineColor = "#000000"; graph.type = "column"; graph.lineAlpha = 1; graph.fillAlphas = 1; graph.columnWidth = 0.3; // this makes it narrower than color graphs graph.stackable = false; // bullet graph should not stack graph.clustered = false; // this makes the trick - one column above another chart.addGraph(graph); // WRITE chart.write("chartdiv"); }); function formatValue(value, formattedValue, valueAxis){ if(value === 0){ return "little"; } else if(value == 50){ return "so-so"; } else if (value == 100){ return "a lot!"; } else{ return ""; } }
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn
文章转载自:慧都控件网本文探讨 SQL Server 中 NULL 和空值之间的区别,并讨论如何有效地处理它们。
Unity 是一款功能极其丰富的游戏引擎,允许开发人员将各种媒体集成到他们的项目中。但是,它缺少最令人兴奋的功能之一 - 将 Web 内容(例如 HTML、CSS 和 JavaScript)直接渲染到 3D 场景中的纹理上的能力。在本文中,我们将介绍如何使用 DotNetBrowser 在 Unity3D 中将 Web 内容渲染为纹理。
DevExpress v24.2帮助文档正式发布上线了,请按版本按需下载~
本教程将向您展示如何用MyEclipse构建一个Web项目,欢迎下载最新版IDE体验!
可将任意给予日期和时间数据可视化的Javascript金融图表工具
JavaScript Charts拥有良好兼容性的JavaScript、HTML5图表开发工具
JavaScript MapsJavaScript Maps是一个稳健的交互式的Javascript/HTML5地图库
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@pclwef.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢