Superset项目柱状图来自Echarts
首先Echarts实现柱状图数据缩放初始化默认值的效果
核心代码
设置Datazoom 的start 和end
myChart.showLoading();
$.get(
ROOT_PATH + '/data/asset/data/obama_budget_proposal_2012.list.json',
function (obama_budget_2012) {
myChart.hideLoading();
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true
}
}
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
legend: {
data: ['Growth', 'Budget 2011', 'Budget 2012'],
itemGap: 5
},
grid: {
top: '12%',
left: