首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flot图表:图例和字体

Flot图表:图例和字体
EN

Stack Overflow用户
提问于 2017-04-10 20:25:47
回答 1查看 1.6K关注 0票数 0

我已经使用jQuery Flot库配置了一个条形图。代码如下:

代码语言:javascript
复制
<style>
.flot-chart-bar {
    height: 300px;
}
.flc-bar {
    font-size: 2px;
    border: 1px grey solid;

}

代码语言:javascript
复制
<div class="card profilestats" style="color: #fff !important;">
<div class="card-content" style="background-color: #bdbdbd !important;min-height:320px;">

    <div id="bar-tipoReclamo" class="flot-chart-bar"></div>
    <br>
    <div class="flc-bar" style="background-color: white; "></div>                        

</div>  
<div class="card-action" style="background-color: #757575 !important;;">
    <span>Distribuzione Tipi di Reclamo negli ultimi 3 anni</span>
</div>

这就是酒吧:

代码语言:javascript
复制
        $.plot($("#bar-tipoReclamo"), barData, {
                series: {
                    bars: {
                        show: true,
                        barWidth: 0.13,
                        order: 1
                    }
                },
                valueLabels: {
                    show: true
                },
                xaxis: {
                     ticks: [[0,currentYear-2],[1,currentYear-1],[2,currentYear]]
                },
                legend: {
                    container: '.flc-bar',
                    noColumns: 0,
                    backgroundColor: "white",
                    lineWidth: 0
                },
                grid: {
                    hoverable: true,
                    clickable: true
                },
                tooltip: true,
                tooltipOpts: {
                 content: " %y,%s  " ,
                    shifts: {
                        x: 20,
                        y: 0
                    },
                    defaultTheme: false
                }
            });

现在问题很简单:如何减小图例中单词的字体大小?我已经尝试使用CSS和我在网上找到的一些Legend属性,但似乎都不起作用。

Bar with Legend

我想要减小栏下白色图例中单词的字体。

EN

回答 1

Stack Overflow用户

发布于 2017-04-10 20:54:55

你拥有的CSS应该可以工作,但是font-size: 2px;可能不是你想要的。查看此fiddle获取基于您的代码的完整示例,其中在CSS中指定了font-size。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43323116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档