Пример #1
0
  protected void initComponents() {
    super.initComponents();
    Line series = new Line(chart1.getChart());
    series.add(new int[] {200, 0, 123, 300, 260, -100, 650, 400});
    addCustomLabels();

    editButton = new JButton("Edit...");
    visibleButton = new JCheckBox("Custom labels");
    visibleButton.setSelected(chart1.getAxes().getLeft().getCustomLabels().size() > 0);

    labelModel =
        new SpinnerNumberModel(0, 0, chart1.getAxes().getLeft().getCustomLabels().size() - 1, 1);
    labelSpinner = new JSpinner(labelModel);

    positionSpinner =
        new JSpinner(
            new SpinnerNumberModel(
                0,
                -10000,
                +10000,
                chart1
                    .getAxes()
                    .getLeft()
                    .getCustomLabels()
                    .getItem(labelModel.getNumber().intValue())
                    .getValue()));

    syncDemoControls();
  }
Пример #2
0
  protected void initComponents() {
    super.initComponents();
    Line series = new Line(chart1.getChart());
    series.setVerticalAxis(VerticalAxis.BOTH);

    positionLabel = new JLabel("0%");
    positionSlider =
        new JSlider(JSlider.HORIZONTAL, 0, 100, (int) chart1.getAxes().getLeft().getZPosition());
    axisList = new JComboBox(new String[] {"Left", "Right"});
    axisList.setSelectedIndex(0);
  }