LineChart css y-axis Set side ladder

In a code that draws a line chart, I added a css string to choose from Y price scale to display to the right or the left of the graph.

Here is the code
import java.util.Set;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.chart.CategoryAxis;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

public class XyChart extends Application {

@Override
public void start(Stage stage) {
   stage.setTitle("Line plot");

   final CategoryAxis xAxis = new CategoryAxis();
   final NumberAxis yAxis = new NumberAxis(1, 21,0.1);

   yAxis.setTickUnit(1);
   yAxis.setPrefWidth(35);
   yAxis.setMinorTickCount(10);

   yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis){
        @Override
    public String toString(Number object){
            String label;
            label = String.format("%7.2f", object.floatValue());
            return label;
    }
});
final LineChart<String, Number>lineChart = new LineChart<String, Number>(xAxis, yAxis);

   lineChart.setCreateSymbols(false);
   lineChart.setAlternativeRowFillVisible(false);
   lineChart.setLegendVisible(false);

   XYChart.Series series1 = new XYChart.Series();

    series1.getData().add(new XYChart.Data("Jan", 1));
    series1.getData().add(new XYChart.Data("Feb", 4));
    series1.getData().add(new XYChart.Data("Mar", 2.5));
    series1.getData().add(new XYChart.Data("Apr", 5));
    series1.getData().add(new XYChart.Data("May", 6));
    series1.getData().add(new XYChart.Data("Jun", 8));
    series1.getData().add(new XYChart.Data("Jul", 12));
    series1.getData().add(new XYChart.Data("Aug", 8));
    series1.getData().add(new XYChart.Data("Sep", 11));
    series1.getData().add(new XYChart.Data("Oct", 13));
    series1.getData().add(new XYChart.Data("Nov", 10));
    series1.getData().add(new XYChart.Data("Dec", 20));        

    BorderPane pane = new BorderPane();
    pane.setCenter(lineChart);          
    Scene scene = new Scene(pane, 800, 600);
    lineChart.setAnimated(false);
    lineChart.getData().addAll(series1); 

    String priceSide = "-fx-side: right;";

    Set<Node> axisNode = lineChart.lookupAll(".axis");
        for(final Node axis : axisNode){

            axis.setStyle(priceSide);
        }

    stage.setScene(scene);
    stage.show();
}

public static void main(String[] args) {
    launch(args);
}   
}
I think I'm missing something, because that line is now all collapsed on the left side of the graph.

Just to comment on this part
String priceSide = "-fx-side: right;";

    Set<Node> axisNode = lineChart.lookupAll(".axis");
        for(final Node axis : axisNode){

            axis.setStyle(priceSide);
        }
and trace it correctly: same problem happens if I use
"-fx-side: left;";
What's wrong with this code?

Thank you.

You want to just set right on the NumberAxis side. You set right on the NumberAxis side and axis desabscisses. You can see this in test (axis instanceof NumberAxis) before calling setStyle your loop for.

Tags: Java

Similar Questions

  • Image Viewer does not offer native zoom level unless layout.css.devPixelsPerPx is set to 1.0, which makes all the tiny interface.

    Asked me to shake my question in one sentence, so this is.
    Image Viewer does not offer native zoom level unless layout.css.devPixelsPerPx is set to 1.0, which makes all the tiny interface.

    DevPixelsPerPx is - 1.0 by default, which causes Firefox to scale with the parameter of the BONE, which is perfectly fine. The problem is that it causes also open image files and especially the zoom level, nationwide also identical to the user interface. A zoom level is adapted to the screen, the other is native. (One is a magnifying glass with a '+', the other a '-'.) Or rather, the other * should * be native, but in practice, it is not native, is climbed by the setting of the BONE, making it as arbitrary and fuzzy like any other level of zoom, which defeats the whole point and does not allow access to a native scaling in any reasonable way.

    If you want to experiment, here is something you can try, a bookmarklet that inserts a 'Native' button on the page. It takes into account your level of "net" zoom current and reduced the image natural dimensions.

    (1) select and copy the following script:

    javascript:var btn=document.createElement('button'); btn.style.cssFloat='right'; btn.appendChild(document.createTextNode('Native')); document.body.insertBefore(btn, document.body.firstChild); btn.addEventListener('click', function(){var img=document.querySelector('img');img.style.transform='scale('+(1/window.devicePixelRatio)+')';}, false); void 0;

    (2) right-click a task on your bookmarks bar or, if you do not display this bar, click on the bookmarks menu button and right click a place there, and then click new bookmark

    (3) paste the script in the location line

    (4) assign a name like native, and then click Add a bookmark

    While you look at a picture, click the bookmark (let) to inject the button. Then click on the button to resize the image.

    Success?

    If you change the zoom level of the 'page', click on the new button to resize it due to the change.

  • How to load a css by myself set portlet.

    for example:

    I myCSS.css, creart used by html I include the tag, such as:
    < link type = "text/css" href = "< % = request.getContextPath ()" % > / css/myCSS.css "rel ="stylesheet"/ >"


    in fact, it's not working, just load css weblogic file
    When I maximize the portlet, after manually refresh this page, then load myCSS.css.

    Why? I don't understand.

    someone hits this issue before? kindly let me know, thank you very much.


    ARIS

    The. means search relative to the. file dependencies, so the path that you specify in href must solve compared

    Assume that your folder structure is
    TestPortal
    resources
    yourdepenciesfile. Dependencies
    CSS
    Demos.CSS

    Then, you specify (the search path element means start in folder css compared to where is the file and the href attribute is then search from there)


    CSS

    Your Css file can not be under WEB - INF, it must be in a place which can be reached by the browser

    The framework will do when the file is found is print the following in thesection

    which the browser will then try to download. If you keep your css in WEB - INF file, then the browser will ask for the file, but the server will refuse to serve (as it does not serve any file under WEB - INF)

    "and I added xmlns ="http://www.bea.com/servers/portal/framework/laf/1.0.0"

    You must add xmlns:p = "http://www.bea.com/servers/portal/framework/laf/1.0.0" i.e. you bind the prefix "p" to the namespace specified. Learn about XML namespaces if you have a problem with the above. Your xml file works because you have set the default namespace to be correct, but it is always useful to know how something does not work. If you add xmlns:p then you must add p to the elements, if you set a default you have nothing else. As before read up on top of the XML namespaces

    Published by: deepshet on June 15, 2009 18:59

    Published by: deepshet on June 15, 2009 19:00

  • CSS styling to set the background color of replacement

    I would like to have something that looks like the table of this line replacing using CSS background. The following code does not work for me.

    Part of VBox = new VBox();
    for (int i = 0; i < 5; i ++)
    {
    Button HBox = new HBox();
    button.setAlignment (Pos.CENTER);
    final lblName Label = new Label ("Label" + i);
    lblName.setStyle ("police - fx -:" BOLD "arial 14");
    button.getChildren () .add (lblName);
    button.setMinSize (300, 46);
    button.setMaxSize (300, 46);
    button.setPrefSize (300, 46);

    button.getStyleClass (.add("search-item"));
    If (i % 2 == 0) {}
    button.getStyleClass () .add ("even");
    }
    pane.getChildren () .add (button);
    }

    . Search-item {}
    -fx-background-color: white;
    -fx-border-color: lightgray;
    -fx-border-width: 1px 0 0 0;
    }

    . Search-point: even {}
    -fx-background-color: lightgray;
    }

    You use "yet" as a style class in the code and 'yet' as a CSS pseudo-class. The difficulty here is simple. Just replace: even with even and close the space.

    .search-item.even{
        -fx-background-color: lightgray;
    } 
    
  • LR5.7 setting side Reset changes

    By choosing a picture by using a Collection in the library then make adjustments in the develop module and try to define a star rating various thing happen, photo is reset or a different photo is selected, I think that it has also deleted photos from collection.

    If I select a photo in a folder in the library module, then develop and define a star rating everything seems fine.

    Any ideas what problem could be?

    Create a new catalog in Lightroom to file > new catalog and import of a few images to test if it works very well.

    If has no works fine too, so

    Save your catalog preferences and reset Lightroom. Refer to retrieve the catalog and images after resetting preferences in Lightroom

    ~ Assani

  • How to create horiz 2 side by side nav bars using div and css?

    I am just placing navbars separate left and right side by side horizontally.  The div for the navigation bar right/second hand wants to go under the first, rather than beside it.  Each navigation bar must be 350 px wide.

    I am new to DW, so if you show me what to do in the code, please be specific and fundamental.

    I'm creating nav bars, following the instructions of the DW for Dummies, page 179: 1 pound large), first place the cursor on the page where I want the navigation bar will appear and click on the button DIV insert Panel; (2) name in the ID field, then...

    This is where I can't get the cursor to go to the right of the left navigation bar on the side of existing already created with a tag div and css.

    Thanks for your help.  I am creating a site e-commerce with podcasting.  I want to make the bars of nav for the separate electronic commerce of the podcasting navigation bar and the horizontal at the top of the entire page to take account of the layout of the site.

    InJoy! wrote:

    This is where I can't get the cursor to go to the right of the left navigation bar on the side of existing already created with a tag div and css.

    He's not beside that you currently have on your page until you style the two with css which should arrive later in the tutorial.

    You place the elements juxtaposed by "floating" with css.

    For example:

    A set of links go here.

    Another set of links go here.

    will look like (below) in Dreamweaver design view UNTIL you style them with css

    A set of links go here.

    Another set of links go here.

    Let the links to sit side by side using the attribute 'float' css:

    {#left_navigation}

    Width: 350px;

    float: left;

    }

    {#right_navigation}

    Width: 350px;

    float: left;

    }

    and they will look like:

    A set of links go here. Another set of links go here.

  • CSS designer do not leave me "set page.

    When I go to create a new source CSS, especially a "set in the page" one, it doesn't let me. No dialog box or whatever it is gets up and tells me any kind of error, it doesn't happen. It's like it's not even a button to work.

    Click on the '+' and choose set in the Page as described

  • List Padding in CSS Designer

    I'm putting in place an unordered as a navigation menu using CSS designer list. I put the list-style-type voice against zero, when I try to use CSS Designer to set the padding of the UL to 0px, it works at first, but when I turn off Live View and turn it back on, the padding back. I know how to do this job by manually typing in the CSS, but I wonder if there is a way to make it work using the CSS designer.

    Ah, I see what you're saying. I think it's proabably a bug.

    If you enable the small link in the chain in the center of the filling or the margin, and then type a zero by one side, it works correctly (which is what I did). If you type only a zero without activating the first link, it does nothing. As you found, if you put something else first, then go to zero it works correctly.

    Here is the best place to report this bug...

    https://www.Adobe.com/cfusion/mmForm/index.cfm?name=wishform

  • How I rename an item in the main menu bar ('file', 'Edit'...)? With userChrome.css, I changed the 'content', but the 'label' wrote then.

    I'm changing the name of the main "bookmarks" menu item
    Regarding submenu items, I managed to change their 'content' via userChrome.css.
    But setting a name different in a "content" of the bookmarksMenu in this way only leads to show the new name of the menu with its next "bookmarks" label.
    How can I change the tag or remove its display?

    You cannot change the name of a menu via the code item in userChrome.css because you can use this file to make CSS changes and do not change the attributes.

    If you use a content property {content: "new label"} then you add only the text before or after existing text if you want that button would you like to work.

    You create a simple extension to make such a change or possibly use the extension userchromeJS.

  • Secondary axis on the WPF chart

    Hello

    I'm tracing a secondary value axis on my WPF chart. I have a graphic linked to a table of AnalogWaveform of objects that I change during execution. This table can be different sizes depending on the user's selection, however assume that there are two types of data to the chart.

    I would like to match a data type of my main axis and the other guy to my axis is secondary. For example, I have four AnalogWaveform opposes the plot, two of whom are in Hz (primary) and the other two in Volts (secondary).

    According to the documentation, I need an additional of element under my definition of . What I have is:

             

























    This adds a second value axis to the left of my main axis. What I need is for this axis which will be located to the right of my chart and somehow to draw each AnalogWaveform on the right y-axis.

    I build my locations in the code as follows:


    _graph. Plots.Clear ();

    RawData is my AnalogWaveform[], built in advance based on a response from the server
    foreach (AnalogWaveform waveform in RawData)
    {
    If (waveform! = null)
    {
    field = new plot (waveform. ChannelName);
    parcel of land. DataContext = waveform;

    plots. Add (Plot); plots is a simple list
    }
    }

    _graph. Plots.AddRange (studs); Add locations to graph

    _legend. ItemsSource = plots. Add locations to the legend

    Any help would be appreciated on how to do it.

    Thanks in advance.

    To position your second Y axis across the graph, set the Location property on the axis of Far .

    To associate a plot to a default axis, set the VerticalScale property on the ground in the axis value is appropriate.

  • Custom icon in the icon of the CSS class attribute

    Hello world

    Apex version: 5.0.1

    Universal theme

    Oracle version: 11 GR 2

    I created a custom page, sign in as the picture below. In the icon attribute set spinner fa temporarily CSS classes, instead I need to put a custom, icon that I made icon. I don't know where to add the new icon? I've added an icon in the shared components > files to workspace static but I can not reference an Image of workspace of the class CSS of the icon attribute.


    Can someone tell me where and how to create a new icon for use with the attribute of CSS icon classes?

    Thank you

    customlogin.PNG

    The CSS style related to the use of the property of the icon of the CSS Classes is set up specifically to manage the icons great fonts. Rather than trying to substitute these for host your custom image, it's easier not to specify a class icon CSS and a simple CSS rule allows you to set your picture as a background on the header area of connection:

    .t-Login-header {
      background: url(&WORKSPACE_IMAGES.logo_GUATEFAC.ico) top center no-repeat;
    }
    

    This can be applied on the page of connection Inline CSS property, either as a custom theme CSS Roller rule.

    Also note that even if the property is called "Icon of CSS Classes", the ICO file format is not normally used and in fact may not be returned by all browsers. (Fonts Awesome 'icons' are in fact a vector font glyphs). In this case you would be advised to use a version of the superior image quality of your logo in PNG format.

  • HR crash notepad.exe css editors

    HR 11 Webhelp

    Thank you

    Problem

    I installed custom fonts and they work for most. A subject is not if display correctly, so I tried to change the new code of police using the HR css editor, then the HTML editor. These attempts, however, replaced the css notepad.exe, such as the removal of font names. It seems that the use of notepad.exe is the only way to add additional code to the css (see step 5). How can I straighten things?


    Here are the steps leading to the problem

    1 downloaded and extracted the google font.

    2 double click on each policy separately and installed on the computer.

    3 added each family of fonts in a file of baggage.

    4 using the notepad.exe, edited the css fonts.

    5. Add this code to notepad.exe css to fix a bug in Chrome that prevented showing the new fonts:

    {@-webkit - keyframes fontfix

    from: "{" "opacity: ' 1.

    };

    {body

    Police-family: Roboto;

    do-size: 11px;

    Color: #000000;

    margin: 16px 10px auto;

    }

    {body

    -webkit-animation-delay: 0.1 s;

    -webkit-animation-name: fontfix;

    -webkit-animation-duration: 0.1 s;

    -webkit-animation - number of iterations: 1;

    -webkit-animation-timing-function: linear;

    }

    to {}

    opacity: 1;

    }

    I agree that the file Association should work differently. I always thought that by double-clicking on a CSS should open using what you specify here.

    From my experience, that you configure here is used when you do a right-click of the CSS in the project manager and choose display.

    For you ensure that you end up with what you want is to keep a copy separate from the CSS file and set it in the recipe for the presentation of a single Source.

    See you soon... Rick

  • How extends LineChart?

    I would like to create a class that extends LineChart, but I don't know how.

    Is someone can provide me with an example?

    Thank you

    I created a class using the observable list

    import javafx.collections.ObservableList;
    import javafx.scene.chart.Axis;
    import javafx.scene.chart.LineChart;
    
    /**
     *
     * @author Konrad
     */
    public class LineChartTest extends LineChart
    {
    
        public LineChartTest(Axis axis, Axis axis1, ObservableList ol) {
            super(axis, axis1, ol);
        }
    
    }
    

    Granted I use 8 JavaFX, and I know originally had to use generic drugs, but when I try to add it does not work.

  • Bloated CSS Style sheet...

    My stylesheet is about 60 k uch too big.

    Try to find a way to put it on a diet.

    Is it possible to convert it to 'shorthand css "?

    Set preferences to use the shortcut for the css declarations, I don't see any change in the existing style sheets.

    Help appreciated.

    Dan H.

    BEFORE:

    {p}

    padding: 0px;margin-top: 0px;margin-right: 5px;margin-bottom: 10px;margin-left: 20px;
    

    }

    AFTER:

    p {padding: 0; margin: 5px 10px 20px 0}

    CSS optimizers online-

    http://www.CSSDRIVE.com/index.php/main/csscompressor/

    http://www.Lotterypost.com/CSS-compress.aspx

    http://www.cssoptimiser.com/

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB
    www.Alt-Web.com/blogspot.com

  • on CS3, how can I watch 2 dreamweaver pages side by side?

    I use DW for coding only and I want to see the full page of CSS (not on the side of the sidebar), but pages seem to only appear as tabs behind them.  How can I watch both at the same time side by side? I asked several people this at other sites and peple are clueless.  Here is an example of what I want to do (another text editor) - Kh

    Picture-1.jpg

    UN-optimize the document pane.  Now, you will be able to place two documents side-by-side.

Maybe you are looking for

  • HP ENVY 5530 e-all-in-one: cancellation of registration - can I keep feeling with these cartridges?

    I'm about to cancel my subscription to instant ink I have don't print enough to justify maintaining the subscription (2 pages this month, 0 last month, you get the point). When I cancel, can I keep these cartridges and keep printing from them after t

  • BlackBerry smartphones can not send e-mail

    I can't send the email from my Bold 9870 but someone sent me an email and I was able to answer.Whenever I have email, it displays a red X in the mail

  • Latitude E5510 not start after the installation of Windows 7 64 bit

    Hey all,. Recently, I tried to install Windows 7 on my brother's cell phone to try to update to Vista. The installation went well, but when he tries to restart for the first time, the screen remains empty without having to start. I tried to format th

  • Remove blackBerry Smartphones

    on my last phone not a blackberry, I could delete my call history on my blackberry that im new on how do I have to delete the call history, I made them a both

  • OSB &gt; performance

    HelloHow can I avoid Threads blocked in my approach? (this causes instability on my environment). Is there a guide for configuration for OSB 11 g performance? or should I implements a kind of desing pattern on my evolution?Thanks in advance.MC