* @brief Remove every series, leaving the plot otherwise intact. * * Iterates each attached series, frees its xData / yData / label * buffers, zeroes the slot, and finally resets seriesCount to 0. * Styling fields (title, axis labels, colours, dimensions, legend / * grid visibility) are untouched, so the same Plot can be reused as * a fresh canvas without rebuilding it. * * @param plot Tar
| 1094 | PLOT_LOG("[plot_set_title]: NULL plot -> false"); |
| 1095 | return false; |
| 1096 | } |
| 1097 | |
| 1098 | char* dup = p_strdup(title ? title : ""); |
| 1099 | if (!dup) { |
| 1100 | PLOT_LOG("[plot_set_title]: OOM dup -> false"); |
| 1101 | return false; |
| 1102 | } |
| 1103 | free((char*)plot->title); |
| 1104 | plot->title = dup; |
| 1105 | |
| 1106 | PLOT_LOG("[plot_set_title]: exit -> true"); |
| 1107 | return true; |
| 1108 | } |
| 1109 | |
| 1110 | |
| 1111 | /** |
| 1112 | * @brief Replace both axis labels in one call. |
| 1113 | * |
| 1114 | * Allocates fresh copies of @p xLabel and @p yLabel first; only if |
| 1115 | * both allocations succeed does the function free the previous labels |
| 1116 | * and install the new ones. This all-or-nothing strategy guarantees |
| 1117 | * that the plot is never left in a half-updated state. |
| 1118 | * |
| 1119 | * Passing NULL for either argument is allowed and stores the empty |
nothing calls this directly
no outgoing calls
no test coverage detected