Skip to content

Commit 9e7e89e

Browse files
Merge pull request #518 from contactashish13/issue-517
ChartJS: manual addition of data changes color for existing values
2 parents 5854017 + 40c6b13 commit 9e7e89e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

classes/Visualizer/Module/Utility.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,17 @@ private static function set_defaults_google( $chart, $post_status ) {
187187
}
188188

189189
/**
190-
* Sets some defaults in the chart for ChartJS charts.
190+
* Sets some defaults in the chart for ChartJS charts. Only during first creation.
191191
*
192192
* @since 3.3.0
193193
*
194194
* @access private
195195
*/
196196
private static function set_defaults_chartjs( $chart, $post_status ) {
197+
if ( $post_status !== 'auto-draft' ) {
198+
return;
199+
}
200+
197201
$type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
198202
$series = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true );
199203
$settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );

0 commit comments

Comments
 (0)