Difference between revisions of "Template:Example box"

From HPC Wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#tag:graph| { "version": 2, "height": {{{radius|100}}}, "width": {{{radius|100}}}, {{#ifeq: {{{legend|}}} | - | | "legends": [{"title": "{{{legend|Legend}...")
 
m (Mukund-pondkule-6a11@uni-paderborn.de moved page Template:Example box to Template:Example box)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#tag:graph| {
+
<div style="background: #ffCC99; border: 1px solid #aaaaaa; padding: 6pt; margin: 12pt 0.5em; width: -0.5em">
  "version": 2,
+
[[Image:Example.png|40px|left|Example]]'''Example:'''<br />
  "height": {{{radius|100}}},
+
{{{1}}}
  "width": {{{radius|100}}},
+
</div>
{{#ifeq: {{{legend|}}} | - |
 
| "legends": [{"title": "{{{legend|Legend}}}","fill": "color"}], }}
 
  "padding": "auto",
 
  "marks": [
 
    {
 
      "properties": {
 
        "enter": {
 
          "innerRadius": {"value": {{{innerradius|0}}} },
 
          "stroke": {"value": "white"},
 
          "startAngle": {"field": "layout_start"},
 
          "outerRadius": {"value": {{{radius|100}}} },
 
          "endAngle": {"field": "layout_end"},
 
          "fill": {"field": "x","scale": "color"},
 
        }
 
      },
 
      "from": {
 
        "data": "table",
 
        "transform": [{"field": "y","type": "pie"}]
 
      },
 
      "type": "arc"
 
    }
 
  ],
 
  "data": [
 
    {
 
      "name": "table", "values": {{{values| [
 
      {"x": "peaches","y": 100},
 
      {"x": "plums","y": 32},
 
      {"x": "blueberries","y": 180},
 
      {"x": "strawberries","y": 46},
 
      {"x": "bananas","y": 21}
 
    ] }}}
 
    }
 
  ],
 
  "scales": [
 
    {
 
      "name": "color",
 
      "range": {{{rangeliteral|"category10"}}},
 
      "domain": {"data": "table","field": "x"},
 
      "type": "ordinal"
 
    }
 
  ]
 
} }}</includeonly>
 

Latest revision as of 19:00, 16 September 2020

Example
Example:

{{{1}}}