private Node createAxisOptions() {
    final Button btn = new Button("Axis", GlyphRegistry.get(AwesomeIcon.CARET_DOWN));
    btn.getStyleClass().add("flat-button");

    final ContextMenu menu = new ContextMenu();
    btn.setOnMousePressed(
        new EventHandler<Event>() {
          @Override
          public void handle(Event event) {
            menu.show(btn, Side.BOTTOM, 0, 0);
          }
        });

    MenuItem item = new MenuItem("Y linear", GlyphRegistry.get(AwesomeIcon.CHECK));
    item.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            _chart.axisMode().set(CyclistAxis.Mode.LINEAR);
          }
        });
    item.getGraphic()
        .visibleProperty()
        .bind(Bindings.equal(_chart.axisMode(), CyclistAxis.Mode.LINEAR));
    menu.getItems().add(item);

    item = new MenuItem("Y log", GlyphRegistry.get(AwesomeIcon.CHECK));
    item.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            _chart.axisMode().set(CyclistAxis.Mode.LOG);
          }
        });
    item.getGraphic()
        .visibleProperty()
        .bind(Bindings.equal(_chart.axisMode(), CyclistAxis.Mode.LOG));
    item.disableProperty().bind(Bindings.equal(_chart.getMode(), InventoryChart.ChartMode.STACKED));
    menu.getItems().add(item);

    item = new MenuItem("Y force zero", GlyphRegistry.get(AwesomeIcon.CHECK));
    item.getGraphic().visibleProperty().bind(_chart.forceZero());
    item.disableProperty().bind(Bindings.equal(_chart.getMode(), InventoryChart.ChartMode.STACKED));
    menu.getItems().add(item);
    item.setOnAction(
        new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent e) {
            _chart.forceZero().set(!_chart.forceZero().get());
          }
        });

    return btn;
  }
  @Override
  public void save(IMemento memento) {
    IMemento group = memento.createChild("agents");
    for (AgentInfo info : _agents) {
      IMemento child = group.createChild("agent");
      child.putString("field", info.field);
      child.putString("value", info.value);
    }

    memento.putString("chart-type", _chartType.getValue().toString());

    String nucId = _filters.getValue();
    if (nucId != null) {
      IMemento filter = memento.createChild("filter");
      filter.putString("nuc-id", nucId);
    }

    // axis options
    IMemento axis = memento.createChild("axis-opt");
    axis.putBoolean("mode", _chart.axisMode().get() == CyclistAxis.Mode.LINEAR);
    axis.putBoolean("force-zero", _chart.forceZero().get());

    // chart options
    IMemento chart = memento.createChild("chart-opt");
    chart.putBoolean("mode", _chart.getMode().get() == ChartMode.LINE);
    chart.putBoolean("total", _chart.getShowTotal().getValue());
  }
  @Override
  public void restore(IMemento memento, Context ctx) {
    IMemento group = memento.getChild("agents");
    if (group != null) {
      for (IMemento child : group.getChildren("agent")) {
        addAgent(child.getString("field"), child.getString("value"));
      }
    }

    _chartType.setValue(ChartType.valueOf(memento.getString("chart-type")));
    IMemento filter = memento.getChild("filter");
    if (filter != null) {
      String nucId = filter.getString("nuc-id");
      _filters.getSelectionModel().select(nucId);
    }

    IMemento axis = memento.getChild("axis-opt");
    _chart.axisMode().set(axis.getBoolean("mode") ? CyclistAxis.Mode.LINEAR : CyclistAxis.Mode.LOG);
    _chart.forceZero().set(axis.getBoolean("force-zero"));

    IMemento chart = memento.getChild("chart-opt");
    _chart.setMode(chart.getBoolean("mode") ? ChartMode.LINE : ChartMode.STACKED);
    _chart.setShowTotal(chart.getBoolean("total"));
  }