小编Lui*_* E.的帖子

将图例添加到dc.js中的饼图

我正在构建一个基于dc.js的可视化,其中一个图表是一个饼图.看到:

http://jsfiddle.net/luiseth/t8we6/

我的例子的特点是这个图表显示的标签通常很长,通常会被图表的容器(the <div>)剪掉.所以我想让它们出现在一个传奇中,但我还没有想到如何让图例出现在图表的右侧.我怎样才能做到这一点?玩这个width没有任何帮助,因为图表位于该中心<div>.

我的代码目前是:

chart.width(500)
     .height(180)
     .radius(80)
     .dimension(categoryDimension)
     .group(categoryGroup)
     .legend(dc.legend().x(140).y(0).gap(5));
Run Code Online (Sandbox Code Playgroud)

另外还有一个.label指令用百分比替换标签.

legend pie-chart dc.js

5
推荐指数
1
解决办法
5129
查看次数

到底什么是 OutputIterator 以及如何构建一个与 CGAL Kd_tree::search 一起使用的 OutputIterator?

我使用 CGAL 的 Kd 树实现以及模糊球体作为查询对象来获取以某个点为中心的半径球体中包含的点r_max。这是这个最小的工作示例:

    #include <CGAL/Simple_cartesian.h>
    #include <CGAL/Kd_tree.h>
    #include <CGAL/Search_traits_2.h>
    #include <CGAL/Fuzzy_sphere.h>
    #include <iostream>
    #include <fstream>

    typedef CGAL::Simple_cartesian<double>  K;
    typedef K::Point_2                      Point;
    typedef CGAL::Search_traits_2<K>        TreeTraits;
    typedef CGAL::Kd_tree<TreeTraits>       Kd_tree;
    typedef Kd_tree::Tree                   Tree;
    typedef CGAL::Fuzzy_sphere<TreeTraits>  Sphere;

    int main(int argc, char* argv[])
    {
        double r_max;
        Tree tree;

        /* ... fill the tree with points, set the value of r_max ...*/

        // Report indices for the neighbors within a sphere
        unsigned int   idc_query = tree.size()/2;           // test index
        Tree::iterator kti       = …
Run Code Online (Sandbox Code Playgroud)

c++ iterator class kdtree cgal

0
推荐指数
1
解决办法
1065
查看次数

标签 统计

c++ ×1

cgal ×1

class ×1

dc.js ×1

iterator ×1

kdtree ×1

legend ×1

pie-chart ×1