Widget:Radar: Difference between revisions

From Elwiki
mNo edit summary
mNo edit summary
Line 72: Line 72:
         <polygon stroke="#ccc" fill="#fff" points="
         <polygon stroke="#ccc" fill="#fff" points="
             <!--{for $i=1 to $dim}-->
             <!--{for $i=1 to $dim}-->
             <!--{($xs[$i]*160)|cat:','|cat:($ys[$i]*160)}-->
             <!--{($xs[$i]*160)|cat:','|cat:($ys[$i]*160)|cat:' '}-->
             <!--{/for}-->
             <!--{/for}-->
         "></polygon>
         "></polygon>
         <polygon stroke="#ccc" fill="#eee" points="
         <polygon stroke="#ccc" fill="#eee" points="
             <!--{for $i=1 to $dim}-->
             <!--{for $i=1 to $dim}-->
             <!--{($xs[$i]*120)|cat:','|cat:($ys[$i]*120)}-->
             <!--{($xs[$i]*120)|cat:','|cat:($ys[$i]*120)|cat:' '}-->
             <!--{/for}-->
             <!--{/for}-->
         "></polygon>
         "></polygon>
         <polygon stroke="#ccc" fill="#fff" points="
         <polygon stroke="#ccc" fill="#fff" points="
             <!--{for $i=1 to $dim}-->
             <!--{for $i=1 to $dim}-->
             <!--{($xs[$i]*80)|cat:','|cat:($ys[$i]*80)}-->
             <!--{($xs[$i]*80)|cat:','|cat:($ys[$i]*80)|cat:' '}-->
             <!--{/for}-->
             <!--{/for}-->
         "></polygon>
         "></polygon>
         <polygon stroke="#ccc" fill="#eee" points="
         <polygon stroke="#ccc" fill="#eee" points="
             <!--{for $i=1 to $dim}-->
             <!--{for $i=1 to $dim}-->
             <!--{($xs[$i]*40)|cat:','|cat:($ys[$i]*40)}-->
             <!--{($xs[$i]*40)|cat:','|cat:($ys[$i]*40)|cat:' '}-->
             <!--{/for}-->
             <!--{/for}-->
         "></polygon>
         "></polygon>
         <!--{for $i=1 to $dim}-->
         <!--{for $i=1 to $dim}-->
         <line x1="0" y1="0" x2="<!--{$xs[$i]*200}-->" y2="<!--{$ys[$i]*200}-->" stroke="#ccc"></line>
         <line x1="0" y1="0" x2="<!--{$xs[$i]*200}-->" y2="<!--{$ys[$i]*200}-->" stroke="#ccc"></line>
         <text
         <text
             transform="
             transform="
Line 110: Line 110:
             <!--{$numer=$value[$i-1]|default:0}-->
             <!--{$numer=$value[$i-1]|default:0}-->
             <!--{$ratio=$numer/$denom}-->
             <!--{$ratio=$numer/$denom}-->
             <!--{(200*$ratio*$xs[$i])|cat:','|cat:(200*$ratio*$ys[$i])}-->
             <!--{(200*$ratio*$xs[$i])|cat:','|cat:(200*$ratio*$ys[$i])|cat:' '}-->
             <!--{/for}-->
             <!--{/for}-->
         "></polygon>
         "></polygon>

Revision as of 08:35, 29 May 2020

Widget:Radar is a component for radar chart.

Arguments are listed as following:

  • Array argument(s) can be called multiple times.
Key Type Description Default
size String Size of the chart, use CSS notation (Depends on parent container)
dim Integer Number of axes
fontfamily String Name of font(s) Microsoft YaHei
fontsize Number Font size 24
color HexColor (#RRGGBB format only) The color for the radar area
label Array<String> Label(s) for each axis in sequence (Empty String)
max Array<Number>
    or
Integer
Max value for each axis.
  • When using an integer, all axes will have the same max value.
  • When using an array, each axis will use the corresponding max value.
  • When using an array but the corresponding max value is missing, the first value in the array will be used.
max[0] (Array Type)
value Array<Number> Value for each axis. 0