[英]how to remove the y-axis line and format the value of the y-axis in google column chart
[英]In jqPlot, how to remove the y-axis line?
我知道這個問題有點重復
但是由於該問題沒有得到確認的答案(發布的問題對我不起作用),因此我在這里再次提出疑問。
我從jqPlot網頁復制了一個簡單的示例作為條形圖示例,並且想要刪除y軸線而不將其更改為$ .jqplot.CategoryAxisRenderer(它可以像我的x軸一樣隱藏該軸線)。
http://jsfiddle.net/marsant/HndmB/3/
碼:
$(document).ready(function(){
var s1 = [200, 600, 700, 1000, 600];
// Can specify a custom tick Array.
// Ticks should match up one for each y value (category) in the series.
var ticks = ['May', 'June', 'July', 'August', 'September'];
var plot1 = $.jqplot('chart1', [s1], {
// The "seriesDefaults" option is an options object that will
// be applied to all series in the chart.
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: { barWidth: 20 },
color:'blue',
shadow: false,
},
grid: {
drawBorder: false,
shadow: false,
},
axes: {
// Use a category axis on the x axis and use our custom ticks.
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks,
tickOptions: { showGridline: false, showMark: false },
showTickMarks: false,
},
// Pad the y axis just a little so bars can get close to, but
// not touch, the grid boundaries. 1.2 is the default padding.
yaxis: {
pad: 1.05,
tickOptions: { formatString: '$%d', showMark: false },
showTickMarks: false,
}
}
});
});
更新 :
此代碼示例為我工作
yaxis: {
renderer: $.jqplot.LinearAxisRenderer,
rendererOptions: { drawBaseline: false, },
... ...
}
您可以嘗試在grid選項之后和axes選項之前插入:
axesDefaults: {
rendererOptions: {
drawBaseline: false
}
},
希望能幫助到你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.