问题
could you please tell me remove labels y axis labels .I make a simple chart using fusion library . http://www.fusioncharts.com/dev/chart-attributes.html?chart=area2d I saw some y axis label 0$,4$,12$..etc I want to remove that label .I need to show chart like this as shown in image [![enter image description here][1]][1] http://jsfiddle.net/Tu57h/135/
can we show this on right side as shown in image ?
here is my code http://jsfiddle.net/Tu57h/135/
FusionCharts.ready(function () {
var salesChart = new FusionCharts({
type: 'msarea',
renderAt: 'chart-container',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Sales of Liquor",
"subCaption": "Previous week vs current week",
"xAxisName": "Day",
"numberPrefix": "$",
"paletteColors": "#0075c2,#1aaf5d",
"bgColor": "#ffffff",
"showBorder": "0",
"showCanvasBorder": "0",
"plotBorderAlpha": "10",
"usePlotGradientColor": "0",
"legendBorderAlpha": "0",
"legendShadow": "0",
"plotFillAlpha": "60",
"showXAxisLine": "1",
"axisLineAlpha": "25",
"showValues": "0",
"captionFontSize": "14",
"subcaptionFontSize": "14",
"subcaptionFontBold": "0",
"divlineColor": "#999999",
"divLineIsDashed": "1",
"divLineDashLen": "1",
"divLineGapLen": "1",
"showAlternateHGridColor": "0",
"toolTipColor": "#ffffff",
"toolTipBorderThickness": "0",
"toolTipBgColor": "#000000",
"toolTipBgAlpha": "80",
"toolTipBorderRadius": "2",
"toolTipPadding": "5",
},
"categories": [
{
"category": [
{
"label": "jan 2015"
},
{
"label": "feb 2015"
},
{
"label": "mar 2015"
},
{
"label": "may 2015"
},
{
"label": "jun 2015"
},
{
"label": "jul 2015"
},
{
"label": "aug 2015"
},{
"label": "sep 2015"
},{
"label": "oct 2015"
}
,{
"label": "nov 2015"
},{
"label": "dec 2015"
}
]
}
],
"dataset": [
{
"seriesname": "Previous Week",
"data": [
{
"value": "13000"
},
{
"value": "14500"
},
{
"value": "13500"
},
{
"value": "15000"
},
{
"value": "15500"
},
{
"value": "17650"
},
{
"value": "19500"
}
]
}
]
}
})
.render();
});
回答1:
What's shown on the right side of your image are trendlines. You can remove the y-axis labels with showYAxisValues: "0"
in your chart setup, and add trendlines with:
"trendlines": [
{
"line": [
{
"startvalue": "12000",
"color": "#1aaf5d",
"valueOnRight": "1",
"displayvalue": "$12K"
}
]
}
]
fiddle here http://jsfiddle.net/Tu57h/138/
回答2:
I'm not sure if the API offers such functionality. However, to hide the y-axis labels, you may target the section of the DOM created by the API and hide it.
setTimeout(function () {
$('#chart-container .fusioncharts-yaxis-0-gridlabels').eq(0).hide();
}, 50);
Fiddle : http://jsfiddle.net/Tu57h/137/ ( I couldn't get it working on jsfiddle but it works fine when running on local machine).
来源:https://stackoverflow.com/questions/32402753/how-to-remove-of-y-axis-label-in-chart