From: Zyan O. <aut...@gm...> - 2005-03-08 12:24:29
|
hi all , i'm developing a financial data chart but facing some problems using jcharts: this is in the try block of the service method : >> LegendProperties legendProperties = new LegendProperties(); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( false ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); Stroke[] strokes= { LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE }; Shape[] shapes= {null}; LineChartProperties lineChartProperties = new LineChartProperties(strokes,shapes); String[] xAxisLabels= {"1998", "1999", "2000", "2001", "2002", "2003", "2004"}; String xAxisTitle= "Years"; String yAxisTitle= "Problems"; String title= "Market Behavior: 5 day index"; DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle,title ); //From AxisChartServlet.java:createAxisChartDataSet double[][] data= new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, 8000}};; String[] legendLabels= { "Bugs"}; Paint[] paints= new Paint[]{Color.blue.darker()}; AxisChartDataSet acds = new AxisChartDataSet(data, legendLabels, paints,ChartType.LINE, lineChartProperties ); dataSeries.addIAxisPlotDataSet(acds); AxisChart axisChart = new AxisChart(dataSeries, chartProperties, axisProperties,legendProperties, 550, 360); ServletEncoderHelper.encodeJPEG13(axisChart, 1.0f, resp); >> Was trying to stream the pic to the page as well as to the disk, but some error is occuring because of which i am not getting any image. Can you help me with what is it that i am doing wrong? Best Regards, auto. |
From: Pradeep N. <pra...@gm...> - 2005-03-09 12:01:00
|
Let us know the exception or tell us what the problem was. Its better to debug the application from exception than from hundreds of lines!! -----Original Message----- From: jch...@li... [mailto:jch...@li...] On Behalf Of Zyan Ocular Sent: Tuesday, March 08, 2005 11:24 PM To: jch...@li... Subject: [jCharts-developers] what's going wrong here hi all , i'm developing a financial data chart but facing some problems using jcharts: this is in the try block of the service method : >> LegendProperties legendProperties = new LegendProperties(); ChartProperties chartProperties = new ChartProperties(); AxisProperties axisProperties = new AxisProperties( false ); ChartFont axisScaleFont = new ChartFont( new Font( "Georgia Negreta cursiva", Font.PLAIN, 13 ), Color.black ); axisProperties.getXAxisProperties().setScaleChartFont( axisScaleFont ); axisProperties.getYAxisProperties().setScaleChartFont( axisScaleFont ); ChartFont axisTitleFont = new ChartFont( new Font( "Arial Narrow", Font.PLAIN, 14 ), Color.black ); axisProperties.getXAxisProperties().setTitleChartFont( axisTitleFont ); axisProperties.getYAxisProperties().setTitleChartFont( axisTitleFont ); Stroke[] strokes= { LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE, LineChartProperties.DEFAULT_LINE_STROKE }; Shape[] shapes= {null}; LineChartProperties lineChartProperties = new LineChartProperties(strokes,shapes); String[] xAxisLabels= {"1998", "1999", "2000", "2001", "2002", "2003", "2004"}; String xAxisTitle= "Years"; String yAxisTitle= "Problems"; String title= "Market Behavior: 5 day index"; DataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, yAxisTitle,title ); //From AxisChartServlet.java:createAxisChartDataSet double[][] data= new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, 8000}};; String[] legendLabels= { "Bugs"}; Paint[] paints= new Paint[]{Color.blue.darker()}; AxisChartDataSet acds = new AxisChartDataSet(data, legendLabels, paints,ChartType.LINE, lineChartProperties ); dataSeries.addIAxisPlotDataSet(acds); AxisChart axisChart = new AxisChart(dataSeries, chartProperties, axisProperties,legendProperties, 550, 360); ServletEncoderHelper.encodeJPEG13(axisChart, 1.0f, resp); >> Was trying to stream the pic to the page as well as to the disk, but some error is occuring because of which i am not getting any image. Can you help me with what is it that i am doing wrong? Best Regards, auto. |