<commit_before>/***********************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Actuate Corporation - initial API and implementation
 ***********************************************************************/

package org.eclipse.birt.chart.computation.withaxes;

/**
 * AxisSubUnit
 */
public final class AxisSubUnit
{

	/** Value to accumulate all values or positive values */
	private double dValueLast = 0;
	/** Value to accumulate negative values */
	private double dValueLastNegative = 0;

	/** Total value of all positive values */
	private double dPositiveTotal = 0;
	/** Total value of all negative values */
	private double dNegativeTotal = 0;
	/** Total value of all values, only used when stack together */
	private double dTotal = 0;

	/** The field stores max position of series in axes. */
	private double dLastMaxPosition = Double.NaN;
	
	/** The field stores min position of series in axes. */
	private double dLastMinPosition = Double.NaN;
	
	/** Return positive and negative values should be accumulated together or not */
	private final boolean bStackTogether;

	/**
	 * Constructor
	 * 
	 * @param bStackTogether
	 *            indicates if stack together
	 */
	AxisSubUnit( boolean bStackTogether )
	{
		this.bStackTogether = bStackTogether;
	}

	public final void reset( )
	{
		dValueLastNegative = 0;
		dValueLast = 0;
	}
	<commit_msg>Check in #194785 Caused by not resetting some properties after rendering finished. This issue only exists in chart examples, because once window is refreshed, example code won't call generator.build() to recompute the chart, but only use the previous properties to render. Fixed by resetting last stacked position after series rendering finished.<commit_after>/***********************************************************************
 * Copyright (c) 2004, 2007 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Actuate Corporation - initial API and implementation
 ***********************************************************************/

package org.eclipse.birt.chart.computation.withaxes;

/**
 * AxisSubUnit
 */
public final class AxisSubUnit
{

	/** Value to accumulate all values or positive values */
	private double dValueLast = 0;
	/** Value to accumulate negative values */
	private double dValueLastNegative = 0;

	/** Total value of all positive values */
	private double dPositiveTotal = 0;
	/** Total value of all negative values */
	private double dNegativeTotal = 0;
	/** Total value of all values, only used when stack together */
	private double dTotal = 0;

	/** The field stores max position of series in axes. */
	private double dLastMaxPosition = Double.NaN;
	
	/** The field stores min position of series in axes. */
	private double dLastMinPosition = Double.NaN;
	
	/** Return positive and negative values should be accumulated together or not */
	private final boolean bStackTogether;

	/**
	 * Constructor
	 * 
	 * @param bStackTogether
	 *            indicates if stack together
	 */
	AxisSubUnit( boolean bStackTogether )
	{
		this.bStackTogether = bStackTogether;
	}

	public final void reset( )
	{
		dValueLastNegative = 0;
		dValueLast = 0;
		dLastMaxPosition = Double.NaN;
		dLastMinPosition = Double.NaN;
	}
	
{'fraction_non_alphanumeric': 0.1484437350359138, 'fraction_numerical': 0.010641127959563713, 'mean_word_length': 4.081081081081081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6208071', 'n_tokens_mistral': 1037, 'n_tokens_neox': 927, 'n_words': 387}