* @brief Apply the built-in light theme. * * Sets the five chrome colours in one call: * - background: @c 0xFFFFFF (pure white), * - grid lines: @c 0xDCDCDC (very pale grey), * - axes & text: @c 0x000000 (black), * - legend background: @c 0xF5F5F5 (off-white), * - legend text: @c 0x000000. * * This is the same palette plot_create() installs by default,
| 1602 | * @endcode |
| 1603 | */ |
| 1604 | bool plot_set_series_label(Plot* plot, size_t index, const char* label) { |
| 1605 | PLOT_LOG("[plot_set_series_label]: enter (plot=%p, index=%zu, label=%s)", (void*)plot, index, label ? label : "(null)"); |
| 1606 | if (!plot || index >= plot->seriesCount) { |
| 1607 | PLOT_LOG("[plot_set_series_label]: bad arg or OOR -> false"); |
| 1608 | return false; |
| 1609 | } |
| 1610 | char* dup = NULL; |
| 1611 | |
| 1612 | if (label) { |
| 1613 | size_t n = strlen(label) + 1; |
| 1614 | dup = (char*)malloc(n); |
| 1615 | |
| 1616 | if (!dup) { |
| 1617 | PLOT_LOG("[plot_set_series_label]: OOM dup -> false"); |
| 1618 | return false; |
| 1619 | } |
| 1620 | memcpy(dup, label, n); |
nothing calls this directly
no test coverage detected