* @brief Toggle the grid on / off. * * Controls whether the renderer draws the 11x11 background grid lines * inside the plot frame. The grid is drawn in @c plot->gridColor (see * plot_set_grid_color()) so its visibility against the chart's * background is style-sensitive. * * @param plot Target plot. NULL is a no-op. * @param show true to render the grid; false to hide it. */
| 675 | bool plot_update_series_data(Plot* plot, size_t seriesIndex, const float* xData, const float* yData, size_t dataSize) { |
| 676 | PLOT_LOG("[plot_update_series_data]: enter (plot=%p, seriesIndex=%zu, dataSize=%zu)", (void*)plot, seriesIndex, dataSize); |
| 677 | if (!plot || seriesIndex >= plot->seriesCount || !yData || dataSize == 0) { |
| 678 | PLOT_LOG("[plot_update_series_data]: bad arg or OOR -> false"); |
| 679 | return false; |
| 680 | } |
| 681 | |
| 682 | float* xCopy = NULL; |
| 683 | if (xData) { |
| 684 | xCopy = (float*)malloc(sizeof(float) * dataSize); |
| 685 | if (!xCopy) { |
| 686 | PLOT_LOG("[plot_update_series_data]: OOM xCopy -> false"); |
| 687 | return false; |
| 688 | } |
| 689 | memcpy(xCopy, xData, sizeof(float) * dataSize); |
| 690 | } |
nothing calls this directly
no outgoing calls
no test coverage detected