Set defaults for Legend Mode, Legend Placement & others in Panel JSON

Hi, we are trying to set default values for legend mode and stack series to custom defaults but we have not been able to override them. We have tried to set and modify the panel data directly from the datasource to use the defaults we want but it is not being set as desired. Is there a way to edit the panelJSON directly from the plugin? This has been cumbersome for our stakeholders to set the legend values every time they create a new dashboard.

use the grafana API to post to your panel. Set the values in the payload Dashboard HTTP API | Grafana documentation