public JSONObject getJSON( ChartSeriesHandle[] series, WorkBookHandle wbh, Double[] minMax ) throws JSONException
	{
		JSONObject chartObjectJSON = new JSONObject();

		// Type JSON
		chartObjectJSON.put( "type", getTypeJSON() );

		// Deal with Series
		double yMax = 0.0;
		double yMin = 0.0;
		int nSeries = 0;
		JSONArray seriesJSON = new JSONArray();
		JSONArray seriesCOLORS = new JSONArray();
		boolean bHasBubbles = false;
		try
		{
			// must trap min and max for axis tick and units
			for( ChartSeriesHandle sery1 : series )
			{
				JSONArray seriesvals = CellRange.getValuesAsJSON( sery1.getSeriesRange(), wbh );
				nSeries = Math.max( nSeries, seriesvals.length() );
				for( int j = 0; j < seriesvals.length(); j++ )
				{
					try
					{
						yMax = Math.max( yMax, seriesvals.getDouble( j ) );
						yMin = Math.min( yMin, seriesvals.getDouble( j ) );
					}
					catch( NumberFormatException n )
					{
						;
					}
				}
				if( !sery1.hasBubbleSizes() )
				{
					seriesJSON.put( seriesvals );
				}
				else
				{
					bHasBubbles = true;
				}
				seriesCOLORS.put( FormatConstants.SVGCOLORSTRINGS[sery1.getSeriesColor()] );
			}
			if( bHasBubbles )
			{
				// 20080423 KSC: Go thru a second time, after obtaining yMax and yMin, for bubble sizes ...
				for( ChartSeriesHandle sery : series )
				{
					JSONArray bubbles = new JSONArray();
					JSONArray seriesvals = CellRange.getValuesAsJSON( sery.getSeriesRange(), wbh );
					JSONArray catvals = CellRange.getValuesAsJSON( sery.getCategoryRange(), wbh );
					JSONArray bubblesizes = CellRange.getValuesAsJSON( sery.getBubbleSizes(), wbh );
					for( int j = 0; j < catvals.length(); j++ )
					{
						JSONObject jo = new JSONObject();
						try
						{
							jo.put( "x", catvals.getDouble( j ) );
						}
						catch( Exception e )
						{
							jo.put( "x", j + 1 );
						}
						jo.put( "y", seriesvals.getDouble( j ) );
						jo.put( "size",
						        Math.round( bubblesizes.getDouble( j ) / ((yMax - yMin) / nSeries) ) );        // TODO: bubble sizes ration is a guess!!
						bubbles.put( jo );
					}
					seriesJSON.put( bubbles );
				}
			}
			chartObjectJSON.put( "Series", seriesJSON );
			chartObjectJSON.put( "SeriesFills", seriesCOLORS );
		}
		catch( JSONException je )
		{
			// TODO: Log error
		}
		minMax[0] = yMin;
		minMax[1] = yMax;
		minMax[2] = (double) nSeries;
		return chartObjectJSON;
	}