I wanna dots instead of displaying it as a whole line in Linechart
Hi Folks,
I had one small doubt in the output of this program. The program is related to LineChart..Actually, Im getting the output as Line in the chart, but my requirement is to display only dots instead of displaying as a line...
I just want only displaying as dots at particular name, insteading of getting that whole line from beginning to end...
First of all whether its posiible to get dots or not?? and if it is possible, how??
Here is the code:
package com.home.practise.streams;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.DefaultDrawingSupplier;
import org.jfree.chart.plot.DrawingSupplier;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.LineAndShapeRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
public class LineChartDemo5 extends ApplicationFrame {
public LineChartDemo5(final String title) {
super(title);
final CategoryDataset dataset = createDataset();
final JFreeChart chart = createChart(dataset);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
private CategoryDataset createDataset() {
// row keys...
final String series1 = "First";
final String series2 = "Second";
final String series3 = "Third";
// column keys...
final String type1 = "Hari";
final String type2 = "Chary";
final String type3 = "Trinetra";
final String type4 = "Naveen";
final String type5 = "Type 5";
final String type6 = "Type 6";
final String type7 = "Type 7";
final String type8 = "Type 8";
// create the dataset...
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(0, series1, type1);
dataset.addValue(0, series1, type2);
dataset.addValue(1, series1, type3);
dataset.addValue(1, series1, type4);
/*dataset.addValue(5.0, series1, type5);
dataset.addValue(7.0, series1, type6);
dataset.addValue(7.0, series1, type7);
dataset.addValue(8.0, series1, type8);*/
/*dataset.addValue(5.0, series2, type1);
dataset.addValue(7.0, series2, type2);
dataset.addValue(6.0, series2, type3);
dataset.addValue(8.0, series2, type4);
dataset.addValue(4.0, series2, type5);
dataset.addValue(4.0, series2, type6);
dataset.addValue(2.0, series2, type7);
dataset.addValue(1.0, series2, type8);
dataset.addValue(4.0, series3, type1);
dataset.addValue(3.0, series3, type2);
dataset.addValue(2.0, series3, type3);
dataset.addValue(3.0, series3, type4);
dataset.addValue(6.0, series3, type5);
dataset.addValue(3.0, series3, type6);
dataset.addValue(4.0, series3, type7);
dataset.addValue(3.0, series3, type8);*/
return dataset;
private JFreeChart createChart(final CategoryDataset dataset) {
final JFreeChart chart = ChartFactory.createLineChart(
"visualization", // chart title
"Names", // domain axis label
"Gender", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // urls
// final StandardLegend legend = (StandardLegend) chart.getLegend();
// legend.setDisplaySeriesShapes(true);
final Shape[] shapes = new Shape[3];
int[] xpoints;
int[] ypoints;
// right-pointing triangle
xpoints = new int[] {-3, 3, -3};
ypoints = new int[] {-3, 0, 3};
shapes[0] = new Polygon(xpoints, ypoints, 3);
// vertical rectangle
shapes[1] = new Rectangle2D.Double(-2, -3, 3, 6);
// left-pointing triangle
xpoints = new int[] {-3, 3, 3};
ypoints = new int[] {0, -3, 3};
shapes[2] = new Polygon(xpoints, ypoints, 3);
final DrawingSupplier supplier = new DefaultDrawingSupplier(
DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
shapes
final CategoryPlot plot = chart.getCategoryPlot();
plot.setDrawingSupplier(supplier);
chart.setBackgroundPaint(Color.yellow);
// set the stroke for each series...
plot.getRenderer().setSeriesStroke(
0,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {10.0f, 6.0f}, 0.0f
plot.getRenderer().setSeriesStroke(
1,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {6.0f, 6.0f}, 0.0f
plot.getRenderer().setSeriesStroke(
2,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {2.0f, 6.0f}, 0.0f
// customise the renderer...
final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
// renderer.setDrawShapes(true);
renderer.setItemLabelsVisible(true);
// renderer.setSeriesLinesVisible(0, false);
// renderer.setBaseLinesVisible(false);
// renderer.setBaseShapesVisible(true);
// renderer.setSeriesLinesVisible(1, true);
// renderer.setLabelGenerator(new StandardCategoryLabelGenerator());
// customise the range axis...
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0.12);
return chart;
public static void main(final String[] args) {
final LineChartDemo5 demo = new LineChartDemo5("Line Chart Demo 5");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}And here is the link, I have just used the above program from this link only
http://www.java2s.com/Code/Java/Chart/JFreeChartLineChartDemo5showingtheuseofacustomdrawingsupplier.htm
It looks like you're using BasicStrokes to create dashed lines
plot.getRenderer().setSeriesStroke(
0,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {10.0f, 6.0f}, 0.0f
plot.getRenderer().setSeriesStroke(
1,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {6.0f, 6.0f}, 0.0f
plot.getRenderer().setSeriesStroke(
2,
new BasicStroke(
2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND,
1.0f, new float[] {2.0f, 6.0f}, 0.0f
); Is this not what you want? If you want points instead of dashes you just specify *1f* for first argument in the float array
new BasicStroke(...,...,...,...,new float[]{1f,6f},....); That indicates that you want the dashed regions to be ~1 pixel long - that is, a point - and the empty regions between the dashes to be ~6 pixels long.
Similar Messages
-
The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!
You must go in the labview option menu, you can select 'use the local
separator' in the front side submenu (LV6i).
If you use the "From Exponential/Fract/Eng" vi, you are able to select this
opton (with a boolean) without changing the labview parameters.
(sorry for my english)
Lange Jerome
FRANCE
"Nina" a ecrit dans le message news:
[email protected]..
> I would like to read a text file in which the decimal numbers are
> using dots instead of commas. Is there a way of converting this in
> labVIEW, or how can I get the program to enterpret the figures in the
> correct way?
>
> The program doest enterpret my figures from the text file in the
> correct way since the numbers contain dots instea
d of commas. Is there
> a way to fix this in labVIEW, or do I have to change the files before
> reading them in the program? Thanks beforehend! -
All tools in Photoshop CS5 not moving smoothly (only making dots instead of lines)
All my tools in Photoshop CS5, including the brush, eraser, healing brush, etc. are only making dots, instead of drawing smooth lines. When using the brush tool, for example, if I click down and drag my mouse to draw something, only the initial dot for where I clicked down gets colored in. Does anyone have any ideas as to why?
Does anything jump out to you that could be causing this problem? Also, my lasso tool doesn't work properly as I can't drag anywhere. The move tool also doesn't work properly. I can click down and drag a layer, but after I release my click, the layer moves back to its previous position. The only way to move any layers is by free-transforming them.
-
When I try to open a .pdf file it asks me to save the file instead of displaying it.
When I try to open a .pdf file it asks me to save the file instead of displaying it?
Gilad, I am new and I don’t know how to reply within the discussion site. The browser I use is Firefox. Thank you for any assistance.
Martin
Go Gators!!!!!!!!
Martin M. Henderson, Jr.
[personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
[This is an open forum, not Adobe support, please do not post personal information]
[If you are posting using email, please turn your 'sig file' function OFF for posting] -
Revision: 15865
Revision: 15865
Author: [email protected]
Date: 2010-05-02 19:22:20 -0700 (Sun, 02 May 2010)
Log Message:
FM-505: Add text to link instead of displaying URL
Ticket Links:
http://bugs.adobe.com/jira/browse/FM-505
Modified Paths:
osmf/trunk/framework/OSMF/org/osmf/elements/F4MElement.asHi,
Solution is very simple:
<af:column headerText="company">
<af:commandLink text="#{row.Company}">
<af:setActionListener from="#{row.rowKeyStr}"
to="#{requestScope.currentRowKey}"/>
</af:commandLink>
</af:column>
On the detail page in PageDef.xml add action (for the same iterator)setCurrentRowWithKey - as argument set #{requestScope.currentRowKey}. Don't forget invoke this action when page is loading setting Refresh Condition= #{adfFacesContext.postback == false}
Kuba -
Revision: 15864
Revision: 15864
Author: [email protected]
Date: 2010-05-02 19:21:01 -0700 (Sun, 02 May 2010)
Log Message:
FM-505: Add text to link instead of displaying URL
Ticket Links:
http://bugs.adobe.com/jira/browse/FM-505
Modified Paths:
osmf/trunk/framework/OSMF/org/osmf/net/StreamingURLResource.asHi,
Solution is very simple:
<af:column headerText="company">
<af:commandLink text="#{row.Company}">
<af:setActionListener from="#{row.rowKeyStr}"
to="#{requestScope.currentRowKey}"/>
</af:commandLink>
</af:column>
On the detail page in PageDef.xml add action (for the same iterator)setCurrentRowWithKey - as argument set #{requestScope.currentRowKey}. Don't forget invoke this action when page is loading setting Refresh Condition= #{adfFacesContext.postback == false}
Kuba -
Need to read messages from the log instead of displaying
Hi,
I need to read all the messages from the log with a particular log no..
i was able to display it using FM BAL_DSP_LOG_DISPLAY..But i want to collect the messages instead of displaying..To display according to my requirement..
Thanks in advanceUse this for reading :
BAL_LOG_MSG_READ
Regards
Neha -
Brush is making dots instead of a line
Last night in CS5 I was playing with the opacity and spacing of the brush, and now I can't get back to a normal brush.
I want just a normal stroke, but the brush is making lots of transparent dots instead.
I've switched to Photoshop Elements 7 for now and everything is fine there, it's only CS5.Have you tried choosing a different brush preset? (With the Brush tool selected, right-click on your canvas and choose something from the list)
Have you tried resetting the Brush tool? (right-click the brush tool icon in the upper left, next to all the options, and choose "Reset Tool") -
When formatting a date field in a where clause the template put dot instead of comma
Hello to Headstart Workers !
In a query find block the template construct a where clause, in some cases, and i dont know when the template is formatting a date field putting a dot instead of a comma.
Ex.: to_date('19-01-2001'.'DD-MM-YYYY')
Anybody knows why or where the template do this.
Congratulations
Nelson- We created it using the HS utilities.
- "nls_numeric_character = ,.".
- it onky happen when the field date is not the first field in the where clause.
- i can see the problem just after pressing find button, already in the ls_block in last_query.
- the find_query works normally but cannot edit any line in ls_block.
Hope that i had helping
Regards
Nelson
null -
hi!
excuse me, i have a problem:
i have some artworks in some songs, i can see them on the iTunes, but when i eject the iPod, it only shows a gray dot instead of the art, does anyone know why is this? please, help!
iPod Video 60 Gb. Windows XP ProHey jid,
Same happens to me... Just not the gray dot. I can see my album art in iTunes but when I'm listening to my iPod alone, no album artwork shows up at all.
See my post: http://discussions.apple.com/thread.jspa?threadID=527211&tstart=0
HELP anyone!
~annmarie~ -
PHP page link is trying to download instead of displaying
Hello -
I created a php login page that had User Authentication and a
Dynamic List on it. The login page was displayed when a user
clicked on a button from a previous page. At the beginning the php
login page would display correctly after pressing the button from
the earlier page, but while I was working on the login page itself
I would just display it (press F12). After I thought I was almost
done, I tried to get to the login page from the button but it
didn't work anymore! I get asked if I want to save or open the
file, then when I select Open it takes me to Dreamweaver. I have
taken out all of the connnections to the database (php code) to see
if it would make the php file show up again, but it doesn't. Can
anyone tell me what is going on here?Sounds like you need to speak sternly to your host.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"ncPurcell" <[email protected]> wrote in
message
news:fphp2m$rq7$[email protected]..
> It is trying to download the file instead of displaying
it. I don't know
> what changed to make it do that. I created another php
file and it does
> the same thing :O( -
Dots instead of time/volume bar
Every so often, my ipod nano will show a row of blue dots instead of the bar that shows the time that a track has been playing or the volume. It eventually goes away, but I'm not sure what I did to make it go away. Any suggestions as to what to do to get rid of the dots and make the time/volume bar come back?
That is the rating screen - where you can rate from 0-5 stars for the song that is currently playing. Use the wheel to select the rating, the press the center button to return to the progress bar.
Cheers!
-Bryan -
My visual voice mail is not working, is there something not turned on?
The following from Apple Support has troubleshooting for voicemail problems including
When tapping the Voicemail button, iPhone calls voicemail instead of displaying the Visual Voicemail list
http://support.apple.com/kb/TS4430 -
how do if ix my voicemail. the phone dials voicemail when I press the voicemail button, instead of displaying the greetings tab.
Hello there, BigAppleBorne65.
The following article is specifically written to help you with your issue:
iPhone: Troubleshooting voicemail
http://support.apple.com/kb/TS4430
Review all recommendations on this Knowledge Base article to resolve your issue.
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro D. -
How to display mapviewer labels in two lines instead of one?
Hi,
I have been using the addJDBCTheme to display the map along with the labels as follows:
mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || ':' || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
So the label is displayed as col1Value:col2Value.
Now I need to display the label as follows:
col1Value
col2Value
I tried using this
mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || chr(10) || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
But it doesnt work. This displays col1Valuecol2Value
So I tried using this:
mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 label_value from table_name UNION ALL SELECT geom, col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
This actually works. Meaning it displays the label in two lines. But the two lines are almost attached together, there is no space between them at all. It is sometimes very difficult to read.
Would really appreciate any suggestions to resolve this issue.
Is there any other solution to display a label in two lines? I tried changing the label style to set the line-height. But that does'nt work either.
LakshmiMultiline label aren't supported as yet.
JayantDoes MapViewer 10.1.3 (the latest version for present) support it?
Maybe you are looking for
-
Error while posting depot excise invoice
Dear SAP Experts, We are continually facing the following error while posting "Depot Excise Invoice" on Production sever "Error in allocating Depot Invoice number interval not found Number object J_1IDEPINV" Message no is 8I336 We have already mainta
-
Outlook not seeing link images
Hello All and Happy Friday (the 13th buwahaha) OK, issue Outlook 2010 and 2013 (Exchange Accounts) Users get emails html formatted. Outlook displays the red x with the message "The linked image cannot be displayed. The file may have been moved, ren
-
Acrobat doesn't print documents fully
Hi there, I'm having an issue where certain PDF files do not print completely - i.e. 6 pages are sent successfully to the network printer, but only 2-3 pages actually get physically printed. When I switch to the Reader instead, it prints just fine. I
-
The iTunes Library file cannot be saved. An unkown error occurred [-1450]
Has anyone encountered the following iTunes error, " The iTunes Library file cannot be saved. An unkown error occurred [-1450] " Whenever I shut my iTunes down the next time I start it up the library seems to be lost. I can do an Add Folder to Librar
-
Framemaker+SGML vs InDesign
I have been informed by a colleague that InDesign possesses structured authoring tools to generate XML. My organization is presently using Framemaker+SGML authoring to generate structured markup language. We have some very mature templates that uti