mayur

TrendLines not behaving as expected with msstackedcolumn2dlinedy

Recommended Posts

I am trying to use trendLines in msstackedcolumn2dlinedy. i wanted draw trendLines on secondary axis. but it seems it is bydefault drawing trendline on primary y axis. when i remove trendlines, max primary y axis value is 90. but when i add trendline, max primary y axis value shoots to 7k. That does mean in below case primary y axis trendLine is used even when i have mapped each trendLine to secondary axis. (parentYAxis: 'S'). Could you please help me in this scenario. Also can i draw area chart on secondary axis?
 

Thanks in Advance...

Code:

FusionCharts.ready(function () {
    var revenueChart = new FusionCharts({
        type: 'msstackedcolumn2dlinedy',
        renderAt: 'chart-container',
        width: '500',
        height: '300',
        dataFormat: 'json',
        dataSource: {
        	"chart": {
		        "divlinecolor": "CCCCCC",
		        "alignLegendWithCanvas": "0",
		        "showvalues": "0",
		        "pYAxisName": "Bar Chart",
		        "sYAxisName": "Line Chart"
	        },
	"categories": [
		{
			"category": [
				{
					"label": "Jan"
				},
				{
					"label": "Feb"
				},
				{
					"label": "Mar"
				},
				{
					"label": "Apr"
				}
			]
		}
	],
	"dataset": [
		{
			"dataset": [
				{
					"seriesname": "Purchase1",
					"data": [
						{
							"value": 21
						},
						{
							"value": 18
						},
						{
							"value": 27
						},
						{
							"value": 25
						}
					]
				},
				{
					"seriesname": "Purchase2",
					"data": [
						{
							"value": 63
						},
						{
							"value": 10
						},
						{
							"value": null
						},
						{
							"value": null
						}
					]
				}
			]
		}
	],
	"lineset": [
		{
			"seriesname": "revenue",
			"data": [
				{
					"value": 6173
				},
				{
					"value": 4153
				},
				{
					"value": 7109
				},
				{
					"value": 6142
				}
			]
		}
	],
	"trendLines": [
		{
			"line": [
				{
					"startValue": 6104.8,
					"endValue": 6133.7,
					"displayValue": " ",
					"color": "6baa01",
					"alpha": "80",
					"dashed": "1",
					"parentYAxis": "S"
				}
			]
		}
	]
}
    });
    revenueChart.render();
});

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now