这里我附上小提琴链接
http://jsfiddle.net/anandi2i/9c16urun/3/
无法绘制我的图表,其起始值为2.5,结束值为12.5
jsxGraph API是否支持分数值?我不知道......
知道与此相关的事情的人......请帮助我克服
//Board initialization
brdyy = JXG.JSXGraph.initBoard("jxgbox", {
axis: false,
borders: false,
boundingbox: [2.5, -5, 12.5, 5],
arc: {
firstArrow: true,
lastArrow: true,
fillColor: 'none',
highlightFillColor: 'none',
strokeColor: '#0000ff',
useDirection: false
},
showNavigation: false,
showCopyright: false,
keepaspectratio: false,
grid: false
});
//Axis creation
xaxis = brdyy.create('axis', [
[0, 0],
[1, 0]
], {
firstArrow: true,
lastArrow: true,
ticks: {
insertTicks: false,
drawZero: true,
majorHeight: 10,
minorHeight: 5,
minorTicks: 5,
tickEndings: [2, 2],
ticksDistance: 1,
strokeColor: '#121212',
label: {
offset: [-2, -20]
}
}
});
答案 0 :(得分:0)
要显示2.5和12.5的标签,您必须使用ticksDistance
并将其设置为0.5
。同时将边界框更改为:boundingbox: [2, -5, 13, 5]
,以便它们位于可见区域。