How to set custom colors in amCharts Column Chart
来源:互联网 发布:仁爱版初中英语软件 编辑:程序博客网 时间:2024/05/11 05:34
html
<script type="text/javascript" src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script type="text/javascript" src="http://www.amcharts.com/lib/3/serial.js"></script><script type="text/javascript" src="http://www.amcharts.com/lib/3/themes/none.js"></script>
<div id="chartdiv"></div>
css
#chartdiv {
width : 100%;
height : 500px;
font-size : 11px;
}
JavaScript
var chart = AmCharts.makeChart("chartdiv", {
"theme": "none",
"type": "serial",
"columnWidth":0.01,
"dataProvider": [{
"country": "USA",
"year2004": -3.5,
"year2005": 4.2,
"color":"#009933"
}, {
"country": "UK",
"year2004": -1.7,
"year2005": 3.1,
"color":"#009933"
}, {
"country": "Canada",
"year2004": 2.8,
"year2005": -2.9,
"color":"#009933"
}, {
"country": "Japan",
"year2004": 2.6,
"year2005": -2.3,
"color":"#009933"
}, {
"country": "France",
"year2004": -1.4,
"year2005": 2.1,
"color":"#009933"
}, {
"country": "Brazil",
"year2004": 2.6,
"year2005": -1,
"color":"#009933"
}],
"valueAxes": [{
"unit": "%",
"position": "left",
"title": "GDP growth rate",
}],
"startDuration": 1,
"graphs": [{
"balloonText": "GDP grow in [[category]] (2004): <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"title": "2004",
"type": "column",
"colorField":"color",
"valueField": "year2004"
}, {
"balloonText": "GDP grow in [[category]] (2005): <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"title": "2005",
"type": "column",
"clustered":false,
"columnWidth":0.01,
"valueField": "year2005"
}],
"plotAreaFillAlphas": 0.1,
"categoryField": "country",
"categoryAxis": {
"gridPosition": "start"
}
});
- How to set custom colors in amCharts Column Chart
- how to set custom navigator title
- How to do custom statistic in OPNET
- How to create custom price in Magento?
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
- Units Problem: How to read text size as custom attr from xml and set it to TextView in java code
- How To Split column In SQL
- HOW TO : Select column in Notepad++
- How to give custom labels to x axis of chart control?
- How to create an Excel sheet or chart in VC?
- How to create an Excel sheet or chart in VC?
- How to create a Gantt chart in SharePoint
- How To Install Custom Component in Delphi (into existing package).
- How to define a custom separator in TLex
- How to create readonly columns in MOSS 2007 custom list
- How to use custom delegates in Objective-C
- How to use custom delegates in Objective-C
- How to create custom shortcut in visual studio
- iOS开发多线程篇—多线程简单介绍
- redhat ftp服务器设置
- leveldb源码分析 之 入门使用
- zigbee z-stack 地址类型
- 部署时System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
- How to set custom colors in amCharts Column Chart
- 产品策划二:App启动页的相关
- iOS 时间状态栏的隐藏和显示 重载两个函数即可
- dblp 数据集之python lxml解析
- qt超强精美绘图控件 - QCustomPlot一览 及 安装使用教程
- ESXi中虚拟机使用USB存储设备
- EMI/RFI (开关电源外壳带高压?)
- 见很糟糕的代码#虐心#!
- android 开发中遇到错误及解决办法总结(在别处看到的)