Commit 284e0ecc authored by Paul Asmuth's avatar Paul Asmuth
Browse files

changes from private repo

parent 53cdbe2e
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
# This file is part of the "libstx" project
#   Copyright (c) 2014 Paul Asmuth, Google Inc.
#
# libstx is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License v3.0. You should have received a
# copy of the GNU General Public License along with this program. If not, see
# <http://www.gnu.org/licenses/>.

# chart
add_library(fnord-chart OBJECT
    axisdefinition.cc
    areachart.cc
    barchart.cc
    linechart.cc
    pointchart.cc
    canvas.cc
    domain.cc
    domainprovider.cc
    drawable.cc
    griddefinition.cc
    legenddefinition.cc
    series.cc
    timedomain.cc)

add_executable(test-chart
    $<TARGET_OBJECTS:stx-base>
    $<TARGET_OBJECTS:fnord-chart>
    chart_test.cc)

target_link_libraries(test-chart ${CMAKE_THREAD_LIBS_INIT})
+5 −5
Original line number Diff line number Diff line
/**
 * This file is part of the "FnordMetric" project
 * This file is part of the "libstx" project
 *   Copyright (c) 2011-2014 Paul Asmuth, Google Inc.
 *
 * FnordMetric is free software: you can redistribute it and/or modify it under
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
@@ -13,8 +13,8 @@
#include "areachart.h"
#include "rendertarget.h"

namespace fnordmetric {
namespace ui {
namespace stx {
namespace chart {

char AreaChart::kDefaultLineStyle[] = "none";
char AreaChart::kDefaultLineWidth[] = "1";
@@ -22,7 +22,7 @@ char AreaChart::kDefaultPointStyle[] = "none";
char AreaChart::kDefaultPointSize[] = "2";

AreaChart::AreaChart(
    ui::Canvas* canvas,
    chart::Canvas* canvas,
    bool stacked) :
    Drawable(canvas),
    stacked_(stacked) {}
+20 −13
Original line number Diff line number Diff line
/**
 * This file is part of the "FnordMetric" project
 * This file is part of the "libstx" project
 *   Copyright (c) 2014 Paul Asmuth, Google Inc.
 *
 * FnordMetric is free software: you can redistribute it and/or modify it under
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
#ifndef _FNORDMETRIC_AREACHART_H
#define _FNORDMETRIC_AREACHART_H
#ifndef _libstx_AREACHART_H
#define _libstx_AREACHART_H
#include <stdlib.h>
#include <fnordmetric/ui/axisdefinition.h>
#include <fnordmetric/ui/domain.h>
#include <fnordmetric/ui/continuousdomain.h>
#include <fnordmetric/ui/drawable.h>
#include <fnordmetric/ui/canvas.h>
#include <fnordmetric/ui/colorpalette.h>
#include <fnordmetric/ui/rendertarget.h>
#include "stx/charts/axisdefinition.h"
#include "stx/charts/domain.h"
#include "stx/charts/continuousdomain.h"
#include "stx/charts/drawable.h"
#include "stx/charts/canvas.h"
#include "stx/charts/colorpalette.h"
#include "stx/charts/rendertarget.h"

namespace fnordmetric {
namespace ui {
namespace stx {
namespace chart {

class AreaChart : public Drawable {
public:
@@ -281,6 +281,13 @@ template <typename TX, typename TY, typename TZ>
void AreaChart3D<TX, TY, TZ>::render(
    RenderTarget* target,
    Viewport* viewport) const {
  if (x_domain_.get() == nullptr || y_domain_.get() == nullptr) {
    RAISE(kRuntimeError, "could not build domains");
  }

  x_domain_.get()->build();
  y_domain_.get()->build();

  target->beginGroup("areas");

  for (const auto& area : areas_) {
+4 −4
Original line number Diff line number Diff line
/**
 * This file is part of the "FnordMetric" project
 * This file is part of the "libstx" project
 *   Copyright (c) 2011-2014 Paul Asmuth, Google Inc.
 *
 * FnordMetric is free software: you can redistribute it and/or modify it under
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
@@ -10,8 +10,8 @@
#include "axisdefinition.h"
#include "domain.h"

namespace fnordmetric {
namespace ui {
namespace stx {
namespace chart {

AxisDefinition::AxisDefinition(
    kPosition axis_position) :
+8 −8
Original line number Diff line number Diff line
/**
 * This file is part of the "FnordMetric" project
 * This file is part of the "libstx" project
 *   Copyright (c) 2011-2014 Paul Asmuth, Google Inc.
 *
 * FnordMetric is free software: you can redistribute it and/or modify it under
 * libstx is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License v3.0. You should have received a
 * copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
#ifndef _FNORDMETRIC_AXISDEFINITION_H
#define _FNORDMETRIC_AXISDEFINITION_H
#ifndef _libstx_AXISDEFINITION_H
#define _libstx_AXISDEFINITION_H
#include <utility>
#include <string>
#include <vector>
#include <fnordmetric/ui/domain.h>
#include <fnordmetric/ui/domainprovider.h>
#include "stx/charts/domain.h"
#include "stx/charts/domainprovider.h"

namespace fnordmetric {
namespace ui {
namespace stx {
namespace chart {

class AxisDefinition {
public:
Loading