KD2 Framework  Check-in [4f7c16fea2]

Overview
Comment:SVG Bar: Fix division by zero
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 7.3
Files: files | file ages | folders
SHA1: 4f7c16fea2880401dcf294eccf2d4695e7af0967
User & Date: bohwaz on 2021-12-01 11:32:35
Other Links: branch diff | manifest | tags
Context
2021-12-01
13:15
Calc Writer: Don't treat as numbers if it starts with a zero, it's probably a phone number check-in: 7d317e2adf user: bohwaz tags: 7.3
11:32
SVG Bar: Fix division by zero check-in: 4f7c16fea2 user: bohwaz tags: 7.3
2021-11-30
18:08
SVG graphs: add bar graphs check-in: 269e9aa958 user: bohwaz tags: 7.3
Changes

Modified src/lib/KD2/Graphics/SVG/Bar.php from [f56ab24960] to [6f94253cde].

137
138
139
140
141
142
143


144
145
146
147
148
149
150
			if (!isset($this->count)) {
				$this->count = $count;
			}

			$this->max = max((int)$this->max, max($values));
			$this->min = min((int)$this->min, min($values));
		}



		if (empty($this->count)) {
			return $out;
		}

		$this->margin_left = $this->width * 0.1;
		$this->margin_top = $this->height * 0.1;







>
>







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
			if (!isset($this->count)) {
				$this->count = $count;
			}

			$this->max = max((int)$this->max, max($values));
			$this->min = min((int)$this->min, min($values));
		}

		$this->max = max($this->max, 1);

		if (empty($this->count)) {
			return $out;
		}

		$this->margin_left = $this->width * 0.1;
		$this->margin_top = $this->height * 0.1;