Reputation: 1609
I have a chart plotting by jqplot, it consists of dynamical number of lines based on the DataSeriesToPlot. I want all lines can only be dragged in Y axis, but the constrain to Y property doesn't work. Here is my code, it's highly appreciated if you can help me !!
$j.jqplot.config.enablePlugins = true;
plot1 = $j.jqplot('chart', DataSeriesToPlot,
{
animate : true,
title : 'Draggable Chart Demo',
neighborThreshold : -1,
legend : {
renderer : $j.jqplot.EnhancedLegendRenderer,
show : true,
labels : legendTypes,
showSwatch : true,
predraw : false,
placement : "outsideGrid",
},
seriesDefaults : {
dragable : {
color : '#fffdf6',
constrainTo : 'y',
}
},
axes : {
xaxis : {
pad : 1.1,
renderer : $j.jqplot.DateAxisRenderer,
labelRenderer : $j.jqplot.CanvasAxisLabelRenderer,
label : 'Month',
labelOptions : {
labelPosition : 'middle',
fontFamily : 'Helvetica',
fontSize : '14pt'
},
tickRenderer : $j.jqplot.CanvasAxisTickRenderer,
tickOptions : {
mark : 'outside',
showMark : true,
showGridLine : true,
show : true,
showLabel : true,
fontWeight : 'normal',
angle : -30,
formatString : '%F'
},
tickInterval : "4 months",
showTicks : true,
showTickMarks : true
},
yaxis : {
min : mbMin * 0.8,
max : mbMax * 1.2,
tickRenderer : $j.jqplot.CanvasAxisTickRenderer,
tickOptions : {
mark : 'outside',
showMark : true,
showGridLine : true,
show : true,
showLabel : true,
fontWeight : 'normal',
formatString : '%.2f'
},
labelRenderer : $j.jqplot.CanvasAxisLabelRenderer,
labelOptions : {
fontFamily : 'Helvetica',
fontSize : '14pt'
},
label : 'MB Per Sub',
},
},
highlighter : {
sizeAdjust : 10,
showTooltip : true,
fadeTooltip : true,
tooltipFadeSpeed : "fast",
tooltipOffset : 2,
tooltipAxes : 'both',
tooltipLocation : 'n',
tooltipSeparator : ', ',
useAxesFormatters : true
},
cursor : {
show : true,
showTooltip : true,
followMouse : true,
//showTooltipOutsideZoom : true,
constrainOutsideZoom : false,
showTooltipGridPosition : false,
showTooltipUnitPosition : false,
useAxesFormatters : true,
zoom : true,
looseZoom : true
}
})
}
Upvotes: 0
Views: 221
Reputation: 21
I had the same problem. Try putting the dragable object in the series option.
series: [{
dragable : {
color : '#fffdf6',
constrainTo : 'y',
}
}]
It should work.
Upvotes: 2