VML折线图(二)

类别:编程语言 点击:0 评论:0 推荐:

<!—注: 这里的 @0, 1,2,3,4 分别为<v:formulas> 的第1,2,3,4,5个元素的计算结果-->

                     </v:shapetype>

                     <!-- 定义坐标刻度 y轴-->

                     <v:shapetype id=oyTextLeft coordsize="400,400" adj="1,6">

                            <v:path textboxrect="@4,@5,@6,@7"></v:path>

                            <v:formulas>

                                   <v:f eqn="sum width 0 0 "></v:f>

                                   <v:f eqn="sum 0 #0 1 "></v:f>

                                   <v:f eqn="prod 1 height #1 "></v:f>

                                   <v:f eqn="prod @1 @2 1 "></v:f>

                                   <v:f eqn="sum 0 0 100 "></v:f>

                                   <v:f eqn="sum 0 @3 8 "></v:f>

                                   <v:f eqn="sum 0 0 10 "></v:f>

                                   <v:f eqn="sum @3 30 0 "></v:f>

                            </v:formulas>

                     </v:shapetype>

                     <!--定义坐标刻度 y轴-->

                     <v:shapetype id=oyTextRight coordsize="400,400" adj="1,6">

                            <v:path textboxrect="@4,@5,@6,@7"></v:path>

                            <v:formulas>

                                   <v:f eqn="sum width 0 0 "></v:f>

                                   <v:f eqn="sum 0 #0 1 "></v:f>

                                   <v:f eqn="prod 1 height #1 "></v:f>

                                   <v:f eqn="prod @1 @2 1 "></v:f>

                                   <v:f eqn="sum @0 10 0 "></v:f>

                                   <v:f eqn="sum 0 @3 8 "></v:f>

                                   <v:f eqn="sum @0 100 0 "></v:f>

                                   <v:f eqn="sum @3 30 0 "></v:f>

                            </v:formulas>

                     </v:shapetype>

                     <v:shapetype id=graphLine coordsize="400,400" strokecolor="#aaa" strokeweight=".8pt" path=" m@8@9 l@7@1 e" adj="0,0,400,400">

                            <v:stroke endarrow="oval" endarrowwidth="narrow" endarrowlength="short"></v:stroke>

                            <v:formulas>

                                   <v:f eqn="sum 0 height #2 "></v:f>

                                   <v:f eqn="sum 0 height #3 "></v:f>

                                   <v:f eqn="sum 0 #0 1 "></v:f>

                                   <v:f eqn="prod 1 width #1 "></v:f>

                                   <v:f eqn="prod @3 @2 1 "></v:f>

                                   <v:f eqn="prod 1 @3 2 "></v:f>

                                   <v:f eqn="sum 0 @4 @5 "></v:f>

                                   <v:f eqn="sum @4 @5 0 "></v:f>

                                   <v:f eqn="if @2 @6 @7 "></v:f>

                                   <v:f eqn="if @2 @0 @1 "></v:f>

                                   <v:f eqn="prod @2 @3 1 "></v:f>

                                   <v:f eqn="prod #0 @3 1 "></v:f>

                                   <v:f eqn="sum height 20 0 "></v:f>

                                   <v:f eqn="sum height 80 0 "></v:f>

                            </v:formulas>

                     </v:shapetype>

                     <!-- 绘制x轴坐标 -->

                     <v:shapetype id=oxText coordsize="400,400" adj="0,0">

                            <v:path textboxrect="@10,@12,@11,@13"></v:path>

                            <v:formulas>

                                   <v:f eqn="sum 1 0 0 "></v:f>

                                   <v:f eqn="sum 1 0 0 "></v:f>

                                   <v:f eqn="sum 0 #0 1 "></v:f>

                                   <v:f eqn="prod 1 width #1 "></v:f>

                                   <v:f eqn="prod @3 @2 1 "></v:f>

                                   <v:f eqn="prod 1 @3 2 "></v:f>

                                   <v:f eqn="sum 0 @4 @5 "></v:f>

                                   <v:f eqn="sum @4 @5 0 "></v:f>

                                   <v:f eqn="if @2 @6 @7 "></v:f>

                                   <v:f eqn="if @2 @0 @1 "></v:f>

                                   <v:f eqn="prod @2 @3 1 "></v:f>

                                   <v:f eqn="prod #0 @3 1 "></v:f>

                                   <v:f eqn="sum height 20 0 "></v:f>

                                   <v:f eqn="sum height 80 0 "></v:f>

                            </v:formulas>

                     </v:shapetype>

                     <!-- 绘制y轴刻度-->

                     <v:shape class="oyTextLeft" type="#oyTextLeft" coordsize="400,400" adj="1,5">

                                   <v:textbox class="oText">400</v:textbox>

                     </v:shape>

                     <v:shape class="oyTextLeft" type="#oyTextLeft" adj="2,5">

                                   <v:textbox class="oText">320</v:textbox>

                     </v:shape>

                     <v:shape class="oTextRight" type="#oyTextLeft" adj="3,5">

                                   <v:textbox class="oText">240</v:textbox>

                     </v:shape>

                     <v:shape class="oTextRight" type="#oyTextLeft" adj="4,5">

                                   <v:textbox class="oText">160</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oyTextLeft" adj="5,5">

                                   <v:textbox class="oText">80</v:textbox></v:shape>          

                     <v:shape class="yLine" type="#yLine" adj="1,5"></v:shape>

                     <v:shape class="yLine" type="#yLine" adj="2,5"></v:shape>

                     <v:shape class="yLine" type="#yLine" adj="3,5"></v:shape>

                     <v:shape class="yLine" type="#yLine" adj="4,5"></v:shape>

                     <v:shape class="yLine" type="#yLine" adj="5,5"></v:shape>

                     <!-- X轴坐标刻度绘制 -->

                     <v:shape class="oTextRight" type="#oxText" adj="1,12"><v:textbox class="oText3">1</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="2,13"><v:textbox class="oText3">2</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="3,12"><v:textbox class="oText3">3</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="4,12"><v:textbox class="oText3">4</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="5,12"><v:textbox class="oText3">5</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="6,12"><v:textbox class="oText3">6</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="7,12"><v:textbox class="oText3">7</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="8,12"><v:textbox class="oText3">8</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="9,12"><v:textbox class="oText3">9</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="10,12"><v:textbox class="oText3">10</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="11,12"><v:textbox class="oText3">11</v:textbox></v:shape>

                     <v:shape class="oTextRight" type="#oxText" adj="12,12"><v:textbox class="oText3">12</v:textbox></v:shape>                  

                     <!-- 数据曲线绘制 -->

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="1,12,345,345"></v:shape>                    

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="1,12,365,365"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="2,12,345,156"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="2,12,365,303"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="3,12,156,156"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="3,12,303,283"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="4,12,156,156"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="4,12,283,353"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="5,12,156,154"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="5,12,353,347"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="6,12,154,148"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="6,12,347,316"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="7,12,148,155"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="7,12,316,333"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="8,12,155,156"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="8,12,333,344"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="9,12,156,159"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="9,12,344,362"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="10,12,159,159"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="10,12,362,362"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="11,12,159,159"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="11,12,362,362"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#f11" adj="12,12,159,161"></v:shape>

                     <v:shape class="yLine" type="#graphLine" strokecolor="#6cf" adj="12,12,362,374"></v:shape>

                     <!-- 图例-->

                     <v:shape class="yLine" strokecolor="#f11" strokeweight=".8pt" path=" m160,-35 l190,-35 e">

                            <v:stroke startarrow="oval" startarrowwidth="narrow" startarrowlength="short" endarrow="oval" endarrowwidth="narrow" endarrowlength="short"></v:stroke>

                            <v:path arrowok="t"></v:path></v:shape>                         

                     <v:shape class="Legend">

                            <v:path textboxrect="200,0,300,30"></v:path>

                            <v:textbox class="LegendText">产品A</v:textbox></v:shape> 

                     <v:shape class="yLine" strokecolor="#6cf" strokeweight=".8pt" path=" m330,-35 l360,-35 e">

                            <v:stroke startarrow="oval" startarrowwidth="narrow" startarrowlength="short" endarrow="oval" endarrowwidth="narrow" endarrowlength="short"></v:stroke>

                            <v:path arrowok="t"></v:path></v:shape>

                     <v:shape class="Legend">

                            <v:path textboxrect="370,0,500,30"></v:path>

                            <v:textbox class="LegendText">产品B</v:textbox></v:shape> 

              </v:group>

       </BODY>

</HTML>

本文地址:http://com.8s8s.com/it/it29209.htm