Commit c9144990 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

bar chart fixes

parent b01cf81a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ point chart examples:
--- axis expr can be a tuple!!. e.g for error bars or area
--- middle axis!
--- TimeDomain!
--- max interpolation gap -> draw as missing data

BEGIN BAR CHART WITH
  SELECT
+8 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include "compile.h"
#include "execute.h"
#include "executable.h"
#include "../ui/axisdefinition.h"

namespace fnordmetric {
namespace query {
@@ -40,6 +41,13 @@ public:
    return columns_;
  }

  template <typename T>
  void executeDrawable(T* drawable) {
    child_->execute();
    drawable->addAxis(ui::AxisDefinition::LEFT); // FIPXAUL
    drawable->addAxis(ui::AxisDefinition::BOTTOM); // FIPXAUL
  }

protected:
  std::vector<std::string> columns_;
  Executable* child_;
+5 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ CompiledExpression* compileOperator(
    ASTNode* ast,
    size_t* scratchpad_len) {
  auto symbol = lookupSymbol(name);

  if (symbol == nullptr) {
    fprintf(stderr, "symbol not found!: %s\n", name.c_str());
  }

  assert(symbol != nullptr);

  auto op = new CompiledExpression();
+10 −2
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include "execute.h"
#include "executable.h"
#include "seriesstatement.h"
#include "axisstatement.h"

namespace fnordmetric {
namespace ui {
@@ -55,19 +56,26 @@ public:
    series_stmts_.push_back(series_stmt);
  }

  void addAxisStatement(AxisStatement* axis_stmt) {
    axis_stmts_.push_back(axis_stmt);
  }

  void execute(ui::Canvas* canvas);

  template <typename T>
  void executeDrawable(T* drawable) {
    for (const auto& series_stmt : series_stmts_) {
  printf("execute!");
      series_stmt->executeDrawable(drawable);
    }

    for (const auto& axis_stmt : axis_stmts_) {
      axis_stmt->executeDrawable(drawable);
    }
  }

protected:
  std::vector<SeriesStatement*> series_stmts_;
  //std::vector<AxisStatement*> axis_stmts_;
  std::vector<AxisStatement*> axis_stmts_;
  kDrawStatementType type_;
};

+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ void addExpr(void* scratchpad, int argc, SValue* argv, SValue* out) {
  assert(0);
}

static SymbolTableEntry __add_symbol("add", &addExpr);
SymbolTableEntry __add_symbol("add", &addExpr);

void subExpr(void* scratchpad, int argc, SValue* argv, SValue* out) {
  assert(argc == 2);
Loading