Я знаю, что этот вопрос отчасти дублирует кВ jqPlot, как удалить линию оси y?
jqPlot Styling - How to remove 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, },
... ...
}
Да, это сработало, спасибо! – marsant
Да ... это сработало отлично, спасибо! –