From: Nathaniel G. A. <nat...@ya...> - 2004-03-12 14:13:23
|
oh, you mean labels for the values as in the bar charts? No this is not in the Line Charts yet. If you wanted to modify the source, it should not be too difficult to do. --- David Han <Dav...@na...> wrote: > I didn't even know that ScatterPlot exists since it wasn't included > in the documentation. Isn't a scatter plot supposed to show > correlation between two variables? Anyway, I tried the ScatterPlot > to see whether it can show X-axis labels as well as y point values. > My code below draws a chart (including x-axis and y-axis labels, > title, and legends) but without data points. Am I missing something? > > String[] xAxisLabels = { "1998", "1999", "2000", "2001", > "2002", "2003", "2004" }; > String xAxisTitle = "Years"; > String yAxisTitle = "Problems"; > String title = "Micro$haft at Work"; > DataSeries dataSeries = new DataSeries(xAxisLabels, xAxisTitle, > yAxisTitle, title ); > > double[][] data = new double[][]{ {250, 45, -36, 66, 145, 80, 55} }; > String[] legendLabels = { "Bugs" }; > Paint[] paints = {Color.blue}; > > Stroke[] strokes = { ScatterPlotProperties.DEFAULT_LINE_STROKE }; > Shape[] shapes = { PointChartProperties.SHAPE_CIRCLE }; > ScatterPlotProperties properties = > new ScatterPlotProperties(strokes, shapes); > > AxisChartDataSet axisChartDataSet = > new AxisChartDataSet(data, legendLabels, paints, > ChartType.SCATTER_PLOT, properties ); > dataSeries.addIAxisPlotDataSet (axisChartDataSet); > > ChartProperties chartProperties = new ChartProperties(); > AxisProperties axisProperties = new AxisProperties(); > LegendProperties legendProperties = new LegendProperties(); > > AxisChart axisChart= new AxisChart(dataSeries, chartProperties, > axisProperties, legendProperties, > width-50, height-50); > axisChart.setGraphics2D ( (Graphics2D) panel.getGraphics() ); > axisChart.render(); > > > >Did you try the ScatterPlot? > > > > > > > >--- David Han <Dav...@na...> wrote: > >> Is it possible to display y point values in a line chart? Looks like > > > there aren't any APIs for this. Is this a correct observation? > > > > -- > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > jCharts-users mailing list > jCh...@li... > https://lists.sourceforge.net/lists/listinfo/jcharts-users __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com |