| 1483 | } |
| 1484 | |
| 1485 | void DisplayManager_::drawBarChart(int16_t x, int16_t y, const int data[], byte dataSize, bool withIcon, uint32_t color, uint32_t barBG) |
| 1486 | { |
| 1487 | int availableWidth = withIcon ? (32 - 9) : 32; |
| 1488 | int gap = 1; |
| 1489 | int totalGapsWidth = (dataSize - 1) * gap; |
| 1490 | int barWidth = (availableWidth - totalGapsWidth) / dataSize; |
| 1491 | int startX = withIcon ? 9 : 0; |
| 1492 | |
| 1493 | for (int i = 0; i < dataSize; i++) |
| 1494 | { |
| 1495 | int x1 = x + startX + i * (barWidth + gap); |
| 1496 | int barHeight = data[i]; |
| 1497 | int y1 = (barHeight > 0) ? (8 - barHeight) : 8; |
| 1498 | |
| 1499 | if (barBG > 0) |
| 1500 | { |
| 1501 | // Draw background bar |
| 1502 | drawFilledRect(x1, y, barWidth, 8, barBG); |
| 1503 | } |
| 1504 | |
| 1505 | if (barHeight > 0) |
| 1506 | { |
| 1507 | drawFilledRect(x1, y1 + y, barWidth, barHeight, color); |
| 1508 | } |
| 1509 | } |
| 1510 | } |
| 1511 | |
| 1512 | void DisplayManager_::drawLineChart(int16_t x, int16_t y, const int data[], byte dataSize, bool withIcon, uint32_t color) |
| 1513 | { |
no outgoing calls
no test coverage detected