具体使用代码如下:
var charts = isc.M3Echarts.create({
width: "100%",
height: "100%",
title: chartTitle, //图左上角显示的文字,默认""
subtext: chartSubtext, //图左上角title下方显示的文字,默认""
backgroundColor: "white", //图的底色
showValue: showValue, //是否显示值
isColumnLine: isColumnLine, //是否柱线图
isComparisonChart: isComparisonChart, //是否对比图
isBiaxial: isBiaxial, //是否双轴图
isPie: isPie, //是否饼图
isColumn: isColumn, //是否柱图
isLine: false,
markLine: markLine, //是否显示虚线列
lineData: lineData, //线柱图线数据取数列
comparisonData: comparisonData, //对比的基数列
yLAxisName: yLAxisName,
yLAxisFormatter: yLAxisFormatter, //左边Y轴数据显示格式化
yRAxisName: yRAxisName, //右边Y轴显示名,默认""
yRAxisFormatter: yRAxisFormatter, //右边Y轴数据显示格式化
dataZoomBase: dataZoomBase, //图最多一次出祭祖
// border: "1px solid black", //加入边框
isXOrY:isXOrY, //取左边轴还是取右边轴,true为取右边轴
scale:scale, //坐标轴是否自定义最大最小值
splitNumber:splitNumber, //坐标轴分割数
yAxismax:yAxismax, //最大值
yAxismin:yAxismin, //最小值
radius:[30,20],
isSum:isSum,
dataZoom: {
show: true
},
toolbox: {
show: true,
orient: "vertical",
x: "right",
y: "top",
dataViewShow: true,
magicTypeShow: true,
restoreShow: true,
saveAsImageShow: false,
customToolOneShow: true,
customToolOneTitle: "保存图片",
customToolOneIcon: "",
customToolOneClick: function(chart) {
var img = isc.Img.create({
width: "100%",
height: "100%",
imageType: "stretch",
src: chart.myChart.getDataURL("jpeg")
})
var w = isc.Window.create({
width: "100%",
height: "100%",
title: "保存图片",
showMinimizeButton: false,
showCloseButton: true,
showTitle: true,
showHeader: true,
autoCenter: true,
isModal: true,
showModalMask: true,
items: [img]
});
w.show();
}
},
data: data,
chartSingleClick: function(param) {
if (typeof(chartSingleClick) == "function") {
chartSingleClick(param,charts)
}
},
chartDoubleClick: function(param) {
// 双击事件
if (typeof(chartDoubleClick) == "function") {
chartDoubleClick(param,charts)
}
}
});
</pre><pre name="code" class="javascript">效果图如下:
<img src="https://img-blog.csdn.net/20161024170525378?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
<img src="https://img-blog.csdn.net/20161024170739847" alt="" />