我正在尝试将气泡图的 X 轴和 Y 轴移到中心。我找不到确切的配置。
目前我得到的图表如下所示
我要获取如下图
请帮帮我
最佳答案
我没有看到任何 api options改变轴的位置。所以,我能想到的最好办法就是使用 CSS 进行设置。
var plot2 = $.jqplot('chart1',[arr],{
title: 'Transparent Bubbles',
seriesDefaults:{
renderer: $.jqplot.BubbleRenderer,
rendererOptions: {
bubbleAlpha: 0.6,
highlightAlpha: 0.8
},
shadow: true,
shadowAlpha: 0.05
},
axes:{yaxis:{tickOptions: {showMark:false},min:-500,max:500}, //disable the ticks
xaxis:{tickOptions: {showMark:false},min:-500,max:500}}
});
$('.jqplot-xaxis').css({'zIndex':10,'top':'150px','font-weight':'bold'}); // move the axis to the center of the chart
$('.jqplot-yaxis').css({'zIndex':10,'left':'300px','font-weight':'bold'});
fiddle here .
产生:
关于jquery - 我们如何将 X 和 Y 轴移动到气泡图中的中心 (JQPlot),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21306945/