Configuring Charts - Customizing hover effects for anchors in JavaScript charts
Created using FusionCharts Suite XT - www.fusioncharts.com
by Ayan Bhadury
HTML
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<div id="chart-container">FusionCharts will render here</div>
<button id="change1">Change Line thickness</button>
JavaScript
FusionCharts.ready(function () {
var visitChart = new FusionCharts({
type: 'line',
renderAt: 'chart-container',
width: '500',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Visitors to website",
"subCaption": "Last week",
"xAxisName": "Day",
"yAxisName": "Visits",
"theme": "fint",
"anchorBgHoverColor": "#96d7fa",
"anchorBorderHoverThickness" : "4",
"anchorHoverRadius":"7"
},
"data": [{
"label": "Mon",
"value": "5123"
}, {
"label": "Tue",
"value": "4233"
}, {
"label": "Wed",
"value": "5507"
}, {
"label": "Thu",
"value": "4110"
}, {
"label": "Fri",
"value": "5529"
}, {
"label": "Sat",
"value": "5803"
}, {
"label": "Sun",
"value": "6202"
}]
}
}).render();
function change_thickness() {
visitChart.setChartAttribute("lineThickness","4");
}
document.getElementById("change1").addEventListener("click",change_thickness);
});