利用JFreeChart绘制股票K线图完整解决方案

时间:2022-05-06 04:51:23

网上有很多人在询问如何使用jfreechart来绘制股票K线图,通过阅读其中的一些例子来看,大多比较的凌乱,没有给出一个符合中国股票市场的K线图实例,因为中国的股票市场K线图的颜色表示与国外存在一点差异,也有很多人遇到了如何去掉周六,周日这类不存在交易的日期,网上没有一个很满意的答案,通过实践,本人整理出一个完整的实例,给出完整的注释,只要在eclipse中配置好相应的classpath,甚至不要修改就可以运行,得到一个包含日K线和日成交量的组合图,希望给大家提供一点帮助,同时也希望大家能够一起交流,改进和挖掘更多的功能!

在进行源代码讲解之前,有必要将本人所领悟到的一些关于jfreechart的概念讲述下,jfreechart工具基本上把一个图形分成了几个逻辑部分。 
1.首先是整个的画布对象(chart),画布就相当与一个大的容器,包含一些图形元素,比如为一张白纸 
2.然后是画图区域对象(plot),就是实际图形所占据的区域,比如为白纸上的一个长方形 
3.然后是图形所需要两条轴对象(axis),比如为白纸上的两条轴线 
4.最后是如何进行图像的绘制对象(render),比如为一只画图的笔 
5.除开上面的这些对象,还有一个最主要的就是通过必须的数据集(dataset)来生成图形了 
至于一些具体的对象细节,就只好请各位去阅读相关的API文档了,在这里就不详细的说明

<code class="hljs java has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">package</span> chart;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> java.awt.Color;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//颜色系统</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> java.text.SimpleDateFormat;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//时间格式</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> java.awt.Paint;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//画笔系统</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.data.time.*;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.data.time.Day;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.data.time.ohlc.OHLCSeries;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.data.time.ohlc.OHLCSeriesCollection;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.chart.renderer.xy.*;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.chart.axis.*;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.chart.plot.*;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">import</span> org.jfree.chart.*;

<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">class</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(102, 0, 102);">KLineCombineChart</span> {</span>

<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">void</span> <span class="hljs-title" style="box-sizing: border-box;">main</span>(String[] args) {
SimpleDateFormat dateFormat = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> SimpleDateFormat(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"yyyy-MM-dd"</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置日期格式</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">double</span> highValue = Double.MIN_VALUE;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置K线数据当中的最大值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">double</span> minValue = Double.MAX_VALUE;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置K线数据当中的最小值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">double</span> high2Value = Double.MIN_VALUE;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置成交量的最大值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">double</span> min2Value = Double.MAX_VALUE;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置成交量的最低值</span>
OHLCSeries series = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> OHLCSeries(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">""</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//高开低收数据序列,股票K线图的四个数据,依次是开,高,低,收</span>
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.2</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.58</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.16</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.34</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">27</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.06</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.83</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.96</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">26</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.0</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.1</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.82</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.04</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">25</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.25</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.33</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.88</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.00</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">24</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.05</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.50</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.91</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.25</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">21</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.68</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.05</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.40</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.00</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.68</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.95</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.50</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.69</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.80</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.94</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.50</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.66</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">18</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.88</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.17</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.69</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.80</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">17</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.26</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.98</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.15</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.89</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">14</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.44</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.45</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.13</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.33</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">13</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.13</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.46</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.97</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.42</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.2</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.4</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.81</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.13</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.0</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.0</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.1</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.24</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.6</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.03</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.40</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.95</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.89</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.04</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.70</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.73</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.4</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9.08</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.33</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.88</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.2</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.74</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.17</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.36</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.7</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.46</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.67</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8.27</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">3</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.5</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.48</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.69</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">31</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.4</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.6</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.28</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.43</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.42</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.56</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.31</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.40</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">29</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.42</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.66</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.22</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.33</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.31</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.70</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.15</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.56</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">27</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.05</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.46</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.02</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.41</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">24</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.05</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.09</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6.90</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6.99</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">23</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.12</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.16</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.00</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.03</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">22</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6.96</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.15</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6.93</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.11</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">21</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.10</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.15</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.02</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.07</span>);
series.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.02</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.19</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6.94</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7.14</span>);
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> OHLCSeriesCollection seriesCollection = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> OHLCSeriesCollection();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//保留K线数据的数据集,必须申明为final,后面要在匿名内部类里面用到</span>
seriesCollection.addSeries(series);
TimeSeries series2=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> TimeSeries(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">""</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//对应时间成交量数据</span>
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">260659400</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">27</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">119701900</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">26</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">109719000</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">25</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">178492400</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">24</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">269978500</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">21</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">361042300</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">173912600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">19</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">154622600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">18</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">200661600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">17</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">312799600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">14</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">141652900</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">13</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">221260400</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">12</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">274795400</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">11</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">289287300</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">289063600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">351575300</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">6</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">451357300</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">5</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">442421200</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">671942600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">3</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">9</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">349647800</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">31</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">225339300</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">30</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">160048200</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">29</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">247341700</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">28</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">394975400</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">27</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">475797500</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">24</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">297679500</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">23</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">191760600</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">22</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">232570200</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">21</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">215693200</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
series2.add(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> Day(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">20</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">8</span>, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2007</span>), <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">200287500</span>/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">100</span>);
TimeSeriesCollection timeSeriesCollection=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> TimeSeriesCollection();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//保留成交量数据的集合</span>
timeSeriesCollection.addSeries(series2);

<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//获取K线数据的最高值和最低值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> seriesCount = seriesCollection.getSeriesCount();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//一共有多少个序列,目前为一个</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; i < seriesCount; i++) {
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> itemCount = seriesCollection.getItemCount(i);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//每一个序列有多少个数据项</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> j = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; j < itemCount; j++) {
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (highValue < seriesCollection.getHighValue(i, j)) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//取第i个序列中的第j个数据项的最大值</span>
highValue = seriesCollection.getHighValue(i, j);
}
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (minValue > seriesCollection.getLowValue(i, j)) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//取第i个序列中的第j个数据项的最小值</span>
minValue = seriesCollection.getLowValue(i, j);
}
}

}
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//获取最高值和最低值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> seriesCount2 = timeSeriesCollection.getSeriesCount();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//一共有多少个序列,目前为一个</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; i < seriesCount2; i++) {
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> itemCount = timeSeriesCollection.getItemCount(i);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//每一个序列有多少个数据项</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">for</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> j = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0</span>; j < itemCount; j++) {
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (high2Value < timeSeriesCollection.getYValue(i,j)) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//取第i个序列中的第j个数据项的值</span>
high2Value = timeSeriesCollection.getYValue(i,j);
}
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (min2Value > timeSeriesCollection.getYValue(i, j)) {<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//取第i个序列中的第j个数据项的值</span>
min2Value = timeSeriesCollection.getYValue(i, j);
}
}

}
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> CandlestickRenderer candlestickRender=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> CandlestickRenderer();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置K线图的画图器,必须申明为final,后面要在匿名内部类里面用到</span>
candlestickRender.setUseOutlinePaint(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">true</span>); <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置是否使用自定义的边框线,程序自带的边框线的颜色不符合中国股票市场的习惯</span>
candlestickRender.setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_AVERAGE);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置如何对K线图的宽度进行设定</span>
candlestickRender.setAutoWidthGap(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.001</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置各个K线图之间的间隔</span>
candlestickRender.setUpPaint(Color.RED);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置股票上涨的K线图颜色</span>
candlestickRender.setDownPaint(Color.GREEN);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置股票下跌的K线图颜色</span>
DateAxis x1Axis=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> DateAxis();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置x轴,也就是时间轴</span>
x1Axis.setAutoRange(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置不采用自动设置时间范围</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">try</span>{
x1Axis.setRange(dateFormat.parse(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"2007-08-20"</span>),dateFormat.parse(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"2007-09-29"</span>));<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置时间范围,注意时间的最大值要比已有的时间最大值要多一天</span>
}<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">catch</span>(Exception e){
e.printStackTrace();
}
x1Axis.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置时间线显示的规则,用这个方法就摒除掉了周六和周日这些没有交易的日期(很多人都不知道有此方法),使图形看上去连续</span>
x1Axis.setAutoTickUnitSelection(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置不采用自动选择刻度值</span>
x1Axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置标记的位置</span>
x1Axis.setStandardTickUnits(DateAxis.createStandardDateTickUnits());<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置标准的时间刻度单位</span>
x1Axis.setTickUnit(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> DateTickUnit(DateTickUnit.DAY,<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">7</span>));<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置时间刻度的间隔,一般以周为单位</span>
x1Axis.setDateFormatOverride(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> SimpleDateFormat(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"yyyy-MM-dd"</span>));<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置显示时间的格式</span>
NumberAxis y1Axis=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> NumberAxis();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设定y轴,就是数字轴</span>
y1Axis.setAutoRange(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//不不使用自动设定范围</span>
y1Axis.setRange(minValue*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.9</span>, highValue*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.1</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设定y轴值的范围,比最低值要低一些,比最大值要大一些,这样图形看起来会美观些</span>
y1Axis.setTickUnit(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> NumberTickUnit((highValue*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.1</span>-minValue*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.9</span>)/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10</span>));<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置刻度显示的密度</span>
XYPlot plot1=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> XYPlot(seriesCollection,x1Axis,y1Axis,candlestickRender);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置画图区域对象</span>

XYBarRenderer xyBarRender=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> XYBarRenderer(){
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">private</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">static</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">final</span> <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">long</span> serialVersionUID = <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>L;<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//为了避免出现警告消息,特设定此值</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">public</span> Paint <span class="hljs-title" style="box-sizing: border-box;">getItemPaint</span>(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> i, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">int</span> j){<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//匿名内部类用来处理当日的成交量柱形图的颜色与K线图的颜色保持一致</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span>(seriesCollection.getCloseValue(i,j)>seriesCollection.getOpenValue(i,j)){<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//收盘价高于开盘价,股票上涨,选用股票上涨的颜色</span>
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">return</span> candlestickRender.getUpPaint();
}<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span>{
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">return</span> candlestickRender.getDownPaint();
}
}};
xyBarRender.setMargin(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.1</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置柱形图之间的间隔</span>
NumberAxis y2Axis=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> NumberAxis();<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置Y轴,为数值,后面的设置,参考上面的y轴设置</span>
y2Axis.setAutoRange(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>);
y2Axis.setRange(min2Value*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.9</span>, high2Value*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.1</span>);
y2Axis.setTickUnit(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> NumberTickUnit((high2Value*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1.1</span>-min2Value*<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">0.9</span>)/<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">4</span>));
XYPlot plot2=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> XYPlot(timeSeriesCollection,<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>,y2Axis,xyBarRender);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//建立第二个画图区域对象,主要此时的x轴设为了null值,因为要与第一个画图区域对象共享x轴</span>
CombinedDomainXYPlot combineddomainxyplot = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> CombinedDomainXYPlot(x1Axis);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//建立一个恰当的联合图形区域对象,以x轴为共享轴</span>
combineddomainxyplot.add(plot1, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">2</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//添加图形区域对象,后面的数字是计算这个区域对象应该占据多大的区域2/3</span>
combineddomainxyplot.add(plot2, <span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">1</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//添加图形区域对象,后面的数字是计算这个区域对象应该占据多大的区域1/3</span>
combineddomainxyplot.setGap(<span class="hljs-number" style="color: rgb(0, 102, 102); box-sizing: border-box;">10</span>);<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">//设置两个图形区域对象之间的间隔空间</span>
JFreeChart chart = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> JFreeChart(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"中国联通"</span>, JFreeChart.DEFAULT_TITLE_FONT, combineddomainxyplot, <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">false</span>);
ChartFrame frame = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">new</span> ChartFrame(<span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"中国联通股票"</span>, chart);
frame.pack();
frame.setVisible(<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">true</span>);
}

}</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li><li style="box-sizing: border-box; padding: 0px 5px;">102</li><li style="box-sizing: border-box; padding: 0px 5px;">103</li><li style="box-sizing: border-box; padding: 0px 5px;">104</li><li style="box-sizing: border-box; padding: 0px 5px;">105</li><li style="box-sizing: border-box; padding: 0px 5px;">106</li><li style="box-sizing: border-box; padding: 0px 5px;">107</li><li style="box-sizing: border-box; padding: 0px 5px;">108</li><li style="box-sizing: border-box; padding: 0px 5px;">109</li><li style="box-sizing: border-box; padding: 0px 5px;">110</li><li style="box-sizing: border-box; padding: 0px 5px;">111</li><li style="box-sizing: border-box; padding: 0px 5px;">112</li><li style="box-sizing: border-box; padding: 0px 5px;">113</li><li style="box-sizing: border-box; padding: 0px 5px;">114</li><li style="box-sizing: border-box; padding: 0px 5px;">115</li><li style="box-sizing: border-box; padding: 0px 5px;">116</li><li style="box-sizing: border-box; padding: 0px 5px;">117</li><li style="box-sizing: border-box; padding: 0px 5px;">118</li><li style="box-sizing: border-box; padding: 0px 5px;">119</li><li style="box-sizing: border-box; padding: 0px 5px;">120</li><li style="box-sizing: border-box; padding: 0px 5px;">121</li><li style="box-sizing: border-box; padding: 0px 5px;">122</li><li style="box-sizing: border-box; padding: 0px 5px;">123</li><li style="box-sizing: border-box; padding: 0px 5px;">124</li><li style="box-sizing: border-box; padding: 0px 5px;">125</li><li style="box-sizing: border-box; padding: 0px 5px;">126</li><li style="box-sizing: border-box; padding: 0px 5px;">127</li><li style="box-sizing: border-box; padding: 0px 5px;">128</li><li style="box-sizing: border-box; padding: 0px 5px;">129</li><li style="box-sizing: border-box; padding: 0px 5px;">130</li><li style="box-sizing: border-box; padding: 0px 5px;">131</li><li style="box-sizing: border-box; padding: 0px 5px;">132</li><li style="box-sizing: border-box; padding: 0px 5px;">133</li><li style="box-sizing: border-box; padding: 0px 5px;">134</li><li style="box-sizing: border-box; padding: 0px 5px;">135</li><li style="box-sizing: border-box; padding: 0px 5px;">136</li><li style="box-sizing: border-box; padding: 0px 5px;">137</li><li style="box-sizing: border-box; padding: 0px 5px;">138</li><li style="box-sizing: border-box; padding: 0px 5px;">139</li><li style="box-sizing: border-box; padding: 0px 5px;">140</li><li style="box-sizing: border-box; padding: 0px 5px;">141</li><li style="box-sizing: border-box; padding: 0px 5px;">142</li><li style="box-sizing: border-box; padding: 0px 5px;">143</li><li style="box-sizing: border-box; padding: 0px 5px;">144</li><li style="box-sizing: border-box; padding: 0px 5px;">145</li><li style="box-sizing: border-box; padding: 0px 5px;">146</li><li style="box-sizing: border-box; padding: 0px 5px;">147</li><li style="box-sizing: border-box; padding: 0px 5px;">148</li><li style="box-sizing: border-box; padding: 0px 5px;">149</li><li style="box-sizing: border-box; padding: 0px 5px;">150</li><li style="box-sizing: border-box; padding: 0px 5px;">151</li><li style="box-sizing: border-box; padding: 0px 5px;">152</li><li style="box-sizing: border-box; padding: 0px 5px;">153</li><li style="box-sizing: border-box; padding: 0px 5px;">154</li><li style="box-sizing: border-box; padding: 0px 5px;">155</li><li style="box-sizing: border-box; padding: 0px 5px;">156</li><li style="box-sizing: border-box; padding: 0px 5px;">157</li><li style="box-sizing: border-box; padding: 0px 5px;">158</li><li style="box-sizing: border-box; padding: 0px 5px;">159</li><li style="box-sizing: border-box; padding: 0px 5px;">160</li><li style="box-sizing: border-box; padding: 0px 5px;">161</li><li style="box-sizing: border-box; padding: 0px 5px;">162</li><li style="box-sizing: border-box; padding: 0px 5px;">163</li><li style="box-sizing: border-box; padding: 0px 5px;">164</li><li style="box-sizing: border-box; padding: 0px 5px;">165</li><li style="box-sizing: border-box; padding: 0px 5px;">166</li><li style="box-sizing: border-box; padding: 0px 5px;">167</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li><li style="box-sizing: border-box; padding: 0px 5px;">21</li><li style="box-sizing: border-box; padding: 0px 5px;">22</li><li style="box-sizing: border-box; padding: 0px 5px;">23</li><li style="box-sizing: border-box; padding: 0px 5px;">24</li><li style="box-sizing: border-box; padding: 0px 5px;">25</li><li style="box-sizing: border-box; padding: 0px 5px;">26</li><li style="box-sizing: border-box; padding: 0px 5px;">27</li><li style="box-sizing: border-box; padding: 0px 5px;">28</li><li style="box-sizing: border-box; padding: 0px 5px;">29</li><li style="box-sizing: border-box; padding: 0px 5px;">30</li><li style="box-sizing: border-box; padding: 0px 5px;">31</li><li style="box-sizing: border-box; padding: 0px 5px;">32</li><li style="box-sizing: border-box; padding: 0px 5px;">33</li><li style="box-sizing: border-box; padding: 0px 5px;">34</li><li style="box-sizing: border-box; padding: 0px 5px;">35</li><li style="box-sizing: border-box; padding: 0px 5px;">36</li><li style="box-sizing: border-box; padding: 0px 5px;">37</li><li style="box-sizing: border-box; padding: 0px 5px;">38</li><li style="box-sizing: border-box; padding: 0px 5px;">39</li><li style="box-sizing: border-box; padding: 0px 5px;">40</li><li style="box-sizing: border-box; padding: 0px 5px;">41</li><li style="box-sizing: border-box; padding: 0px 5px;">42</li><li style="box-sizing: border-box; padding: 0px 5px;">43</li><li style="box-sizing: border-box; padding: 0px 5px;">44</li><li style="box-sizing: border-box; padding: 0px 5px;">45</li><li style="box-sizing: border-box; padding: 0px 5px;">46</li><li style="box-sizing: border-box; padding: 0px 5px;">47</li><li style="box-sizing: border-box; padding: 0px 5px;">48</li><li style="box-sizing: border-box; padding: 0px 5px;">49</li><li style="box-sizing: border-box; padding: 0px 5px;">50</li><li style="box-sizing: border-box; padding: 0px 5px;">51</li><li style="box-sizing: border-box; padding: 0px 5px;">52</li><li style="box-sizing: border-box; padding: 0px 5px;">53</li><li style="box-sizing: border-box; padding: 0px 5px;">54</li><li style="box-sizing: border-box; padding: 0px 5px;">55</li><li style="box-sizing: border-box; padding: 0px 5px;">56</li><li style="box-sizing: border-box; padding: 0px 5px;">57</li><li style="box-sizing: border-box; padding: 0px 5px;">58</li><li style="box-sizing: border-box; padding: 0px 5px;">59</li><li style="box-sizing: border-box; padding: 0px 5px;">60</li><li style="box-sizing: border-box; padding: 0px 5px;">61</li><li style="box-sizing: border-box; padding: 0px 5px;">62</li><li style="box-sizing: border-box; padding: 0px 5px;">63</li><li style="box-sizing: border-box; padding: 0px 5px;">64</li><li style="box-sizing: border-box; padding: 0px 5px;">65</li><li style="box-sizing: border-box; padding: 0px 5px;">66</li><li style="box-sizing: border-box; padding: 0px 5px;">67</li><li style="box-sizing: border-box; padding: 0px 5px;">68</li><li style="box-sizing: border-box; padding: 0px 5px;">69</li><li style="box-sizing: border-box; padding: 0px 5px;">70</li><li style="box-sizing: border-box; padding: 0px 5px;">71</li><li style="box-sizing: border-box; padding: 0px 5px;">72</li><li style="box-sizing: border-box; padding: 0px 5px;">73</li><li style="box-sizing: border-box; padding: 0px 5px;">74</li><li style="box-sizing: border-box; padding: 0px 5px;">75</li><li style="box-sizing: border-box; padding: 0px 5px;">76</li><li style="box-sizing: border-box; padding: 0px 5px;">77</li><li style="box-sizing: border-box; padding: 0px 5px;">78</li><li style="box-sizing: border-box; padding: 0px 5px;">79</li><li style="box-sizing: border-box; padding: 0px 5px;">80</li><li style="box-sizing: border-box; padding: 0px 5px;">81</li><li style="box-sizing: border-box; padding: 0px 5px;">82</li><li style="box-sizing: border-box; padding: 0px 5px;">83</li><li style="box-sizing: border-box; padding: 0px 5px;">84</li><li style="box-sizing: border-box; padding: 0px 5px;">85</li><li style="box-sizing: border-box; padding: 0px 5px;">86</li><li style="box-sizing: border-box; padding: 0px 5px;">87</li><li style="box-sizing: border-box; padding: 0px 5px;">88</li><li style="box-sizing: border-box; padding: 0px 5px;">89</li><li style="box-sizing: border-box; padding: 0px 5px;">90</li><li style="box-sizing: border-box; padding: 0px 5px;">91</li><li style="box-sizing: border-box; padding: 0px 5px;">92</li><li style="box-sizing: border-box; padding: 0px 5px;">93</li><li style="box-sizing: border-box; padding: 0px 5px;">94</li><li style="box-sizing: border-box; padding: 0px 5px;">95</li><li style="box-sizing: border-box; padding: 0px 5px;">96</li><li style="box-sizing: border-box; padding: 0px 5px;">97</li><li style="box-sizing: border-box; padding: 0px 5px;">98</li><li style="box-sizing: border-box; padding: 0px 5px;">99</li><li style="box-sizing: border-box; padding: 0px 5px;">100</li><li style="box-sizing: border-box; padding: 0px 5px;">101</li><li style="box-sizing: border-box; padding: 0px 5px;">102</li><li style="box-sizing: border-box; padding: 0px 5px;">103</li><li style="box-sizing: border-box; padding: 0px 5px;">104</li><li style="box-sizing: border-box; padding: 0px 5px;">105</li><li style="box-sizing: border-box; padding: 0px 5px;">106</li><li style="box-sizing: border-box; padding: 0px 5px;">107</li><li style="box-sizing: border-box; padding: 0px 5px;">108</li><li style="box-sizing: border-box; padding: 0px 5px;">109</li><li style="box-sizing: border-box; padding: 0px 5px;">110</li><li style="box-sizing: border-box; padding: 0px 5px;">111</li><li style="box-sizing: border-box; padding: 0px 5px;">112</li><li style="box-sizing: border-box; padding: 0px 5px;">113</li><li style="box-sizing: border-box; padding: 0px 5px;">114</li><li style="box-sizing: border-box; padding: 0px 5px;">115</li><li style="box-sizing: border-box; padding: 0px 5px;">116</li><li style="box-sizing: border-box; padding: 0px 5px;">117</li><li style="box-sizing: border-box; padding: 0px 5px;">118</li><li style="box-sizing: border-box; padding: 0px 5px;">119</li><li style="box-sizing: border-box; padding: 0px 5px;">120</li><li style="box-sizing: border-box; padding: 0px 5px;">121</li><li style="box-sizing: border-box; padding: 0px 5px;">122</li><li style="box-sizing: border-box; padding: 0px 5px;">123</li><li style="box-sizing: border-box; padding: 0px 5px;">124</li><li style="box-sizing: border-box; padding: 0px 5px;">125</li><li style="box-sizing: border-box; padding: 0px 5px;">126</li><li style="box-sizing: border-box; padding: 0px 5px;">127</li><li style="box-sizing: border-box; padding: 0px 5px;">128</li><li style="box-sizing: border-box; padding: 0px 5px;">129</li><li style="box-sizing: border-box; padding: 0px 5px;">130</li><li style="box-sizing: border-box; padding: 0px 5px;">131</li><li style="box-sizing: border-box; padding: 0px 5px;">132</li><li style="box-sizing: border-box; padding: 0px 5px;">133</li><li style="box-sizing: border-box; padding: 0px 5px;">134</li><li style="box-sizing: border-box; padding: 0px 5px;">135</li><li style="box-sizing: border-box; padding: 0px 5px;">136</li><li style="box-sizing: border-box; padding: 0px 5px;">137</li><li style="box-sizing: border-box; padding: 0px 5px;">138</li><li style="box-sizing: border-box; padding: 0px 5px;">139</li><li style="box-sizing: border-box; padding: 0px 5px;">140</li><li style="box-sizing: border-box; padding: 0px 5px;">141</li><li style="box-sizing: border-box; padding: 0px 5px;">142</li><li style="box-sizing: border-box; padding: 0px 5px;">143</li><li style="box-sizing: border-box; padding: 0px 5px;">144</li><li style="box-sizing: border-box; padding: 0px 5px;">145</li><li style="box-sizing: border-box; padding: 0px 5px;">146</li><li style="box-sizing: border-box; padding: 0px 5px;">147</li><li style="box-sizing: border-box; padding: 0px 5px;">148</li><li style="box-sizing: border-box; padding: 0px 5px;">149</li><li style="box-sizing: border-box; padding: 0px 5px;">150</li><li style="box-sizing: border-box; padding: 0px 5px;">151</li><li style="box-sizing: border-box; padding: 0px 5px;">152</li><li style="box-sizing: border-box; padding: 0px 5px;">153</li><li style="box-sizing: border-box; padding: 0px 5px;">154</li><li style="box-sizing: border-box; padding: 0px 5px;">155</li><li style="box-sizing: border-box; padding: 0px 5px;">156</li><li style="box-sizing: border-box; padding: 0px 5px;">157</li><li style="box-sizing: border-box; padding: 0px 5px;">158</li><li style="box-sizing: border-box; padding: 0px 5px;">159</li><li style="box-sizing: border-box; padding: 0px 5px;">160</li><li style="box-sizing: border-box; padding: 0px 5px;">161</li><li style="box-sizing: border-box; padding: 0px 5px;">162</li><li style="box-sizing: border-box; padding: 0px 5px;">163</li><li style="box-sizing: border-box; padding: 0px 5px;">164</li><li style="box-sizing: border-box; padding: 0px 5px;">165</li><li style="box-sizing: border-box; padding: 0px 5px;">166</li><li style="box-sizing: border-box; padding: 0px 5px;">167</li></ul>

为了能够保证K线图的上影线和下影线能够和K线图本身的颜色保持一致,找了很多的方法设置都不成功,可以说目前暂不提供单独绘制K线边框颜色的方法,所以,经过本人的实验,对其中的源代码进行了下修改,具体修改的地方是在下载回来的文件目中source\org\jfree\chart\renderer\xy\CandlestickRenderer.java文件,将

<code class="hljs applescript has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">Paint p = getItemPaint(series, <span class="hljs-property" style="box-sizing: border-box;">item</span>);
Paint outlinePaint = null;
outlinePaint = getItemOutlinePaint(series, <span class="hljs-property" style="box-sizing: border-box;">item</span>);
}</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul>

修改为如下的代码,这样就会保证K线图的上影线和下影线能够和K线图本身的颜色保持一致,符合中国股票市场K线图形颜色的习惯:

<code class="hljs cs has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">Paint p = getItemPaint(series, item);
Paint outlinePaint = <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>;
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.useOutlinePaint) {
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span>(yClose>yOpen){
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.upPaint != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) {
outlinePaint=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.upPaint;
}
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> {
outlinePaint=p;
}
}<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span>{
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">if</span> (<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.downPaint != <span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">null</span>) {
outlinePaint=<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">this</span>.downPaint;
}
<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">else</span> {
outlinePaint=p;
}
}
}
</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li><li style="box-sizing: border-box; padding: 0px 5px;">12</li><li style="box-sizing: border-box; padding: 0px 5px;">13</li><li style="box-sizing: border-box; padding: 0px 5px;">14</li><li style="box-sizing: border-box; padding: 0px 5px;">15</li><li style="box-sizing: border-box; padding: 0px 5px;">16</li><li style="box-sizing: border-box; padding: 0px 5px;">17</li><li style="box-sizing: border-box; padding: 0px 5px;">18</li><li style="box-sizing: border-box; padding: 0px 5px;">19</li><li style="box-sizing: border-box; padding: 0px 5px;">20</li></ul>

然后使用ant集成编译工具,编译重新生成最新的开发包就可以了,如果各位在使用过程中遇到什么问题,欢迎留言探讨,也希望这个实例对大家有所帮助,等有时间了再给大家介绍下jpgraph的K线图的绘制,敬请期待,呵呵! 
利用JFreeChart绘制股票K线图完整解决方案