我一直在试图将 HTML
标签和字符添加到 fusion chart 的 Caption
和 subCaption
中,但无法执行。
我已经尝试了这个文档链接中的方法,还尝试了一个旧方法,但也不起作用。
FusionCharts.ready(function() {
var salesChart = new FusionCharts({
type: 'column2d',
renderAt: 'chart-container',
width: '500',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": ""Quarterly Revenue",
"subCaption": "<span> Last year </span>",
"xAxisName": "Quarter",
"yAxisName": "Amount (In USD)",
"numberPrefix": "$",
//Caption cosmetics
"captionFont": "Arial",
"captionFontSize": "18",
"captionFontColor": "#993300",
"captionFontBold": "1",
"subcaptionFont": "Arial",
"subcaptionFontSize": "14",
"subcaptionFontColor": "#993300",
"subcaptionFontBold": "0",
//Theme
"theme": "fusion"
},
"data": [{
"label": ""Q1",
"value": "1950000"
}, {
"label": "" Q2",
"value": "1450000"
}, {
"label": "Q3",
"value": "1730000"
}, {
"label": "Q4",
"value": "2120000"
}]
}
})
.render();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<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>
<div id="chart-container">FusionCharts will render here</div>
<tspan>
在 SVG 中可以在文本中使用,但在这种情况下仍然无法工作,我需要一种创建它的方法。 - Jithin Raj P R