mbellisle@rgj.com // note, each data item has "bullet" field. var columnChartData = [{ name: "Shelly Berkley", points: 11900, color: "#ac9722", bullet: "http://www.rgj.com/images/Whittemore/chart/shelleyBerkleyChart.png" }, { name: "Dean Heller", points: 27600, color: "#856729", bullet: "http://www.rgj.com/images/Whittemore/chart/deanHellerChart.png" }, { name: "Jon Porter", points: 9200, color: "#83754e", bullet: "http://www.rgj.com/images/Whittemore/chart/jonPorterChart.png" }, { name: "Harry Reid", points: 51000, color: "#858d5e", bullet: "http://www.rgj.com/images/Whittemore/chart/harryReidChart.png" }, { name: "Dina Titus", points: 34700, color: "#789b4b", bullet: "http://www.rgj.com/images/Whittemore/chart/dinaTitusChart.png" }]; AmCharts.ready(function () { // SERIAL CHART var chart = new AmCharts.AmSerialChart(); chart.dataProvider = columnChartData; chart.categoryField = "name"; chart.startDuration = 5; // sometimes we need to set margins manually // autoMargins should be set to false in order chart to use custom margin values chart.autoMargins = true; chart.marginRight = 0; chart.marginLeft = 0; chart.marginBottom = 0; chart.marginTop = 0; // AXES // category var categoryAxis = chart.categoryAxis; categoryAxis.inside = true; categoryAxis.axisAlpha = 0; categoryAxis.gridAlpha = 0; categoryAxis.tickLength = 0; // value var valueAxis = new AmCharts.ValueAxis(); valueAxis.minimum = 0; valueAxis.axisAlpha = 0; valueAxis.maximum = 63000; valueAxis.dashLength = 4; chart.addValueAxis(valueAxis); // GRAPH var graph = new AmCharts.AmGraph(); graph.valueField = "points"; graph.customBulletField = "bullet"; // field of the bullet in data provider graph.bulletOffset = 20; // distance from the top of the column to the bullet graph.colorField = "color"; graph.bulletSize = 75; // bullet image should be rectangle (width = height) graph.type = "column"; graph.fillAlphas = 0.8; graph.cornerRadiusTop = 8; graph.lineAlpha = 0; chart.addGraph(graph); // WRITE chart.write("chartdiv"); }); Campaign contributions made by Harvey Whittemore family members in 2008, 2010 and 2012:
Reproduced with permission of the copyright owner. Further reproduction or distribution is prohibited without permission.