本人正在使用jqplot 制作金融行情图,想实现‘绿涨红跌’的效果,但是jqplot 文档里翻了好几遍只能更改全部蜡烛图的颜色,无法根据涨跌情况进行变化,不知道哪位大神能够给予指导。以下是jqplot 的配置代码。
$(document).ready(function(){
var plot2 = $.jqplot('chart2',[ohlc],{http://ask.csdn.net/#
seriesDefaults:{yaxis:'y2axis'},
axes: {
xaxis: {
renderer:$.jqplot.DateAxisRenderer,
min: "16:20:00",
max: "16:59:00",
tickInterval: "5 minutes",
tickOptions:{
formatString:'%H:%M',
fontSize:'10px'
}
},
y2axis: {
tickOptions:{
formatString:'%d',
fontSize:'10px'
}
}
},
// To make a candle stick chart, set the "candleStick" option to true.
series: [
{
color: '#33AA11',
renderer:$.jqplot.OHLCRenderer,
rendererOptions:{ candleStick:true }
}
],
grid: {
drawGridLines: true, // wether to draw lines across the grid or not.
gridLineColor: '#33AA11', //设置整个图标区域网格背景线的颜色
background: '#fffdf6', //设置整个图标区域的背景色
borderColor: '#999999', //设置图表的(最外侧)边框的颜色
borderWidth: 2.0, //设置图表的(最外侧)边框宽度
},
highlighter: {
show: true,
showMarker:false,
tooltipAxes: 'xy',
yvalues: 4,
formatString:'<table class="jqplot-highlighter"> \
<tr><td>时间:</td><td>%s</td></tr> \
<tr><td>开盘:</td><td>%s</td></tr> \
<tr><td>最高:</td><td>%s</td></tr> \
<tr><td>最低:</td><td>%s</td></tr> \
<tr><td>收盘:</td><td>%s</td></tr></table>'
}
});
});