FusionCharts - Configuring Trendlines cosmetics in Spark Column chart
Created using FusionCharts Suite XT - www.fusioncharts.com
by FusionCharts
HTML
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<!-- Configuring Trendlines cosmetics in Sparkcolumn chart
Attribute
# startvalue - The starting value for the trendline. Say, if you want to plot a slanted trendline from value 102 to 109, the startValue will be 102.
# color - Color of the trend line and its associated text. (In Hex)
# thickness - Lets you define the thickness of trend line.
# dashed - Lets you define whether the trend line will appear as dashed.
# dashedlen - Lets you control the length of each dash
# dashgap - lets you control the length of each dash gap.
# alpha - Alpha (Transparency of the line)
Deviation from theme
# chartBottomMargin
-->
<div id="chart-container">FusionCharts will render here</div>
JavaScript
FusionCharts.ready(function() {
var revenueChart = new FusionCharts({
type: 'sparkcolumn',
renderAt: 'chart-container',
width: '450',
height: '80',
dataFormat: 'json',
dataSource: {
"chart": {
"theme": "fusion",
"caption": "Revenue by Month",
"subcaption": "Last year",
"subCaptionFontSize": "11",
"numberPrefix": "$",
"highColor": "#6baa01",
"lowColor": "#e44a00",
"chartBottomMargin": "30"
},
"dataset": [{
"data": [{
"value": "783000"
},
{
"value": "601000"
},
{
"value": "515000"
},
{
"value": "315900"
},
{
"value": "388000"
},
{
"value": "433000"
},
{
"value": "910000"
},
{
"value": "798000"
},
{
"value": "483300"
},
{
"value": "562000"
},
{
"value": "359400"
},
{
"value": "485000"
}
]
}],
//Adding trendlines in chart
"trendlines": [{
"line": [{
"startvalue": "550000",
"endValue": "700000",
//Trendline related cosmetics
"color": "#ff0000",
"thickness": "1",
"dashed": "1",
"dashedlen": "3",
"dashgap": "3",
"alpha": "100"
}]
}]
}
})
.render();
});